Skip to content

Commit 8d3b33f

Browse files
rustyrussellLinus Torvalds
authored andcommitted
[PATCH] Remove MODULE_PARM
MODULE_PARM was actually breaking: recent gcc version optimize them out as unused. It's time to replace the last users, which are generally in the most unloved drivers anyway. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
1 parent c721bcc commit 8d3b33f

56 files changed

Lines changed: 146 additions & 329 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎Documentation/networking/ray_cs.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ the essid= string parameter is available via the kernel command line.
2525
This will change after the method of sorting out parameters for all
2626
the PCMCIA drivers is agreed upon. If you must have a built in driver
2727
with nondefault parameters, they can be edited in
28-
/usr/src/linux/drivers/net/pcmcia/ray_cs.c. Searching for MODULE_PARM
28+
/usr/src/linux/drivers/net/pcmcia/ray_cs.c. Searching for module_param
2929
will find them all.
3030

3131
Information on card services is available at:

‎Documentation/sound/oss/Introduction‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ are available, for example IRQ, address, DMA.
6969

7070
Warning, the options for different cards sometime use different names
7171
for the same or a similar feature (dma1= versus dma16=). As a last
72-
resort, inspect the code (search for MODULE_PARM).
72+
resort, inspect the code (search for module_param).
7373

7474
Notes:
7575

‎Documentation/sound/oss/cs46xx‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ parameters. for a copy email: twoller@crystal.cirrus.com
8888

8989
MODULE_PARMS definitions
9090
------------------------
91-
MODULE_PARM(defaultorder, "i");
91+
module_param(defaultorder, ulong, 0);
9292
defaultorder=N
9393
where N is a value from 1 to 12
9494
The buffer order determines the size of the dma buffer for the driver.
@@ -98,18 +98,18 @@ to not underrun the dma buffer as easily. As default, use 32k (order=3)
9898
rather than 64k as some of the games work more responsively.
9999
(2^N) * PAGE_SIZE = allocated buffer size
100100

101-
MODULE_PARM(cs_debuglevel, "i");
102-
MODULE_PARM(cs_debugmask, "i");
101+
module_param(cs_debuglevel, ulong, 0644);
102+
module_param(cs_debugmask, ulong, 0644);
103103
cs_debuglevel=N
104104
cs_debugmask=0xMMMMMMMM
105105
where N is a value from 0 (no debug printfs), to 9 (maximum)
106106
0xMMMMMMMM is a debug mask corresponding to the CS_xxx bits (see driver source).
107107

108-
MODULE_PARM(hercules_egpio_disable, "i");
108+
module_param(hercules_egpio_disable, ulong, 0);
109109
hercules_egpio_disable=N
110110
where N is a 0 (enable egpio), or a 1 (disable egpio support)
111111

112-
MODULE_PARM(initdelay, "i");
112+
module_param(initdelay, ulong, 0);
113113
initdelay=N
114114
This value is used to determine the millescond delay during the initialization
115115
code prior to powering up the PLL. On laptops this value can be used to
@@ -118,19 +118,19 @@ system is booted under battery power then the mdelay()/udelay() functions fail t
118118
properly delay the required time. Also, if the system is booted under AC power
119119
and then the power removed, the mdelay()/udelay() functions will not delay properly.
120120

121-
MODULE_PARM(powerdown, "i");
121+
module_param(powerdown, ulong, 0);
122122
powerdown=N
123123
where N is 0 (disable any powerdown of the internal blocks) or 1 (enable powerdown)
124124

125125

126-
MODULE_PARM(external_amp, "i");
126+
module_param(external_amp, bool, 0);
127127
external_amp=1
128128
if N is set to 1, then force enabling the EAPD support in the primary AC97 codec.
129129
override the detection logic and force the external amp bit in the AC97 0x26 register
130130
to be reset (0). EAPD should be 0 for powerup, and 1 for powerdown. The VTB Santa Cruz
131131
card has inverted logic, so there is a special function for these cards.
132132

133-
MODULE_PARM(thinkpad, "i");
133+
module_param(thinkpad, bool, 0);
134134
thinkpad=1
135135
if N is set to 1, then force enabling the clkrun functionality.
136136
Currently, when the part is being used, then clkrun is disabled for the entire system,

‎arch/ppc/8xx_io/cs4218_tdm.c‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,11 @@ static int numReadBufs = 4, readbufSize = 32;
126126
*/
127127
static volatile cbd_t *rx_base, *rx_cur, *tx_base, *tx_cur;
128128

129-
MODULE_PARM(catchRadius, "i");
130-
MODULE_PARM(numBufs, "i");
131-
MODULE_PARM(bufSize, "i");
132-
MODULE_PARM(numreadBufs, "i");
133-
MODULE_PARM(readbufSize, "i");
129+
module_param(catchRadius, int, 0);
130+
module_param(numBufs, int, 0);
131+
module_param(bufSize, int, 0);
132+
module_param(numreadBufs, int, 0);
133+
module_param(readbufSize, int, 0);
134134

135135
#define arraysize(x) (sizeof(x)/sizeof(*(x)))
136136
#define le2be16(x) (((x)<<8 & 0xff00) | ((x)>>8 & 0x00ff))

‎drivers/block/ataflop.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ unsigned char *DMABuffer; /* buffer for writes */
271271
static unsigned long PhysDMABuffer; /* physical address */
272272

273273
static int UseTrackbuffer = -1; /* Do track buffering? */
274-
MODULE_PARM(UseTrackbuffer, "i");
274+
module_param(UseTrackbuffer, int, 0);
275275

276276
unsigned char *TrackBuffer; /* buffer for reads */
277277
static unsigned long PhysTrackBuffer; /* physical address */
@@ -296,7 +296,7 @@ static int MotorOn = 0, MotorOffTrys;
296296
static int IsFormatting = 0, FormatError;
297297

298298
static int UserSteprate[FD_MAX_UNITS] = { -1, -1 };
299-
MODULE_PARM(UserSteprate, "1-" __MODULE_STRING(FD_MAX_UNITS) "i");
299+
module_param_array(UserSteprate, int, NULL, 0);
300300

301301
/* Synchronization of FDC access. */
302302
static volatile int fdc_busy = 0;

‎drivers/cdrom/cm206.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,12 +218,12 @@ static int cm206_base = CM206_BASE;
218218
static int cm206_irq = CM206_IRQ;
219219
#ifdef MODULE
220220
static int cm206[2] = { 0, 0 }; /* for compatible `insmod' parameter passing */
221+
module_param_array(cm206, int, NULL, 0); /* base,irq or irq,base */
221222
#endif
222223

223-
MODULE_PARM(cm206_base, "i"); /* base */
224-
MODULE_PARM(cm206_irq, "i"); /* irq */
225-
MODULE_PARM(cm206, "1-2i"); /* base,irq or irq,base */
226-
MODULE_PARM(auto_probe, "i"); /* auto probe base and irq */
224+
module_param(cm206_base, int, 0); /* base */
225+
module_param(cm206_irq, int, 0); /* irq */
226+
module_param(auto_probe, bool, 0); /* auto probe base and irq */
227227
MODULE_LICENSE("GPL");
228228

229229
#define POLLOOP 100 /* milliseconds */

‎drivers/cdrom/sbpcd.c‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -464,8 +464,13 @@ static int sbpcd[] =
464464
static __cacheline_aligned DEFINE_SPINLOCK(sbpcd_lock);
465465
static struct request_queue *sbpcd_queue;
466466

467-
MODULE_PARM(sbpcd, "2i");
468-
MODULE_PARM(max_drives, "i");
467+
/* You can only set the first pair, from old MODULE_PARM code. */
468+
static int sbpcd_set(const char *val, struct kernel_param *kp)
469+
{
470+
get_options((char *)val, 2, (int *)sbpcd);
471+
return 0;
472+
}
473+
module_param_call(sbpcd, sbpcd_set, NULL, NULL, 0);
469474

470475
#define NUM_PROBE (sizeof(sbpcd) / sizeof(int))
471476

@@ -553,6 +558,7 @@ static unsigned char msgnum;
553558
static char msgbuf[80];
554559

555560
static int max_drives = MAX_DRIVES;
561+
module_param(max_drives, int, 0);
556562
#ifndef MODULE
557563
static unsigned char setup_done;
558564
static const char *str_sb_l = "soundblaster";

‎drivers/char/istallion.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -378,13 +378,13 @@ MODULE_DESCRIPTION("Stallion Intelligent Multiport Serial Driver");
378378
MODULE_LICENSE("GPL");
379379

380380

381-
MODULE_PARM(board0, "1-3s");
381+
module_param_array(board0, charp, NULL, 0);
382382
MODULE_PARM_DESC(board0, "Board 0 config -> name[,ioaddr[,memaddr]");
383-
MODULE_PARM(board1, "1-3s");
383+
module_param_array(board1, charp, NULL, 0);
384384
MODULE_PARM_DESC(board1, "Board 1 config -> name[,ioaddr[,memaddr]");
385-
MODULE_PARM(board2, "1-3s");
385+
module_param_array(board2, charp, NULL, 0);
386386
MODULE_PARM_DESC(board2, "Board 2 config -> name[,ioaddr[,memaddr]");
387-
MODULE_PARM(board3, "1-3s");
387+
module_param_array(board3, charp, NULL, 0);
388388
MODULE_PARM_DESC(board3, "Board 3 config -> name[,ioaddr[,memaddr]");
389389

390390
#endif

‎drivers/char/mxser.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -243,10 +243,10 @@ static int verbose = 0;
243243

244244
MODULE_AUTHOR("Casper Yang");
245245
MODULE_DESCRIPTION("MOXA Smartio/Industio Family Multiport Board Device Driver");
246-
MODULE_PARM(ioaddr, "1-4i");
247-
MODULE_PARM(ttymajor, "i");
248-
MODULE_PARM(calloutmajor, "i");
249-
MODULE_PARM(verbose, "i");
246+
module_param_array(ioaddr, int, NULL, 0);
247+
module_param(ttymajor, int, 0);
248+
module_param(calloutmajor, int, 0);
249+
module_param(verbose, bool, 0);
250250
MODULE_LICENSE("GPL");
251251

252252
struct mxser_log {

‎drivers/char/riscom8.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1743,10 +1743,10 @@ static int iobase;
17431743
static int iobase1;
17441744
static int iobase2;
17451745
static int iobase3;
1746-
MODULE_PARM(iobase, "i");
1747-
MODULE_PARM(iobase1, "i");
1748-
MODULE_PARM(iobase2, "i");
1749-
MODULE_PARM(iobase3, "i");
1746+
module_param(iobase, int, 0);
1747+
module_param(iobase1, int, 0);
1748+
module_param(iobase2, int, 0);
1749+
module_param(iobase3, int, 0);
17501750

17511751
MODULE_LICENSE("GPL");
17521752
#endif /* MODULE */

0 commit comments

Comments
 (0)