Skip to content

Commit

Permalink
[PATCH] Remove MODULE_PARM
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
rustyrussell authored and Linus Torvalds committed Mar 25, 2006
1 parent c721bcc commit 8d3b33f
Show file tree
Hide file tree
Showing 56 changed files with 146 additions and 329 deletions.
2 changes: 1 addition & 1 deletion Documentation/networking/ray_cs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ the essid= string parameter is available via the kernel command line.
This will change after the method of sorting out parameters for all
the PCMCIA drivers is agreed upon. If you must have a built in driver
with nondefault parameters, they can be edited in
/usr/src/linux/drivers/net/pcmcia/ray_cs.c. Searching for MODULE_PARM
/usr/src/linux/drivers/net/pcmcia/ray_cs.c. Searching for module_param
will find them all.

Information on card services is available at:
Expand Down
2 changes: 1 addition & 1 deletion Documentation/sound/oss/Introduction
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ are available, for example IRQ, address, DMA.

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

Notes:

Expand Down
16 changes: 8 additions & 8 deletions Documentation/sound/oss/cs46xx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ parameters. for a copy email: [email protected]

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

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

MODULE_PARM(hercules_egpio_disable, "i");
module_param(hercules_egpio_disable, ulong, 0);
hercules_egpio_disable=N
where N is a 0 (enable egpio), or a 1 (disable egpio support)

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

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


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

MODULE_PARM(thinkpad, "i");
module_param(thinkpad, bool, 0);
thinkpad=1
if N is set to 1, then force enabling the clkrun functionality.
Currently, when the part is being used, then clkrun is disabled for the entire system,
Expand Down
10 changes: 5 additions & 5 deletions arch/ppc/8xx_io/cs4218_tdm.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,11 @@ static int numReadBufs = 4, readbufSize = 32;
*/
static volatile cbd_t *rx_base, *rx_cur, *tx_base, *tx_cur;

MODULE_PARM(catchRadius, "i");
MODULE_PARM(numBufs, "i");
MODULE_PARM(bufSize, "i");
MODULE_PARM(numreadBufs, "i");
MODULE_PARM(readbufSize, "i");
module_param(catchRadius, int, 0);
module_param(numBufs, int, 0);
module_param(bufSize, int, 0);
module_param(numreadBufs, int, 0);
module_param(readbufSize, int, 0);

#define arraysize(x) (sizeof(x)/sizeof(*(x)))
#define le2be16(x) (((x)<<8 & 0xff00) | ((x)>>8 & 0x00ff))
Expand Down
4 changes: 2 additions & 2 deletions drivers/block/ataflop.c
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ unsigned char *DMABuffer; /* buffer for writes */
static unsigned long PhysDMABuffer; /* physical address */

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

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

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

/* Synchronization of FDC access. */
static volatile int fdc_busy = 0;
Expand Down
8 changes: 4 additions & 4 deletions drivers/cdrom/cm206.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,12 +218,12 @@ static int cm206_base = CM206_BASE;
static int cm206_irq = CM206_IRQ;
#ifdef MODULE
static int cm206[2] = { 0, 0 }; /* for compatible `insmod' parameter passing */
module_param_array(cm206, int, NULL, 0); /* base,irq or irq,base */
#endif

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

#define POLLOOP 100 /* milliseconds */
Expand Down
10 changes: 8 additions & 2 deletions drivers/cdrom/sbpcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -464,8 +464,13 @@ static int sbpcd[] =
static __cacheline_aligned DEFINE_SPINLOCK(sbpcd_lock);
static struct request_queue *sbpcd_queue;

MODULE_PARM(sbpcd, "2i");
MODULE_PARM(max_drives, "i");
/* You can only set the first pair, from old MODULE_PARM code. */
static int sbpcd_set(const char *val, struct kernel_param *kp)
{
get_options((char *)val, 2, (int *)sbpcd);
return 0;
}
module_param_call(sbpcd, sbpcd_set, NULL, NULL, 0);

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

Expand Down Expand Up @@ -553,6 +558,7 @@ static unsigned char msgnum;
static char msgbuf[80];

static int max_drives = MAX_DRIVES;
module_param(max_drives, int, 0);
#ifndef MODULE
static unsigned char setup_done;
static const char *str_sb_l = "soundblaster";
Expand Down
8 changes: 4 additions & 4 deletions drivers/char/istallion.c
Original file line number Diff line number Diff line change
Expand Up @@ -378,13 +378,13 @@ MODULE_DESCRIPTION("Stallion Intelligent Multiport Serial Driver");
MODULE_LICENSE("GPL");


MODULE_PARM(board0, "1-3s");
module_param_array(board0, charp, NULL, 0);
MODULE_PARM_DESC(board0, "Board 0 config -> name[,ioaddr[,memaddr]");
MODULE_PARM(board1, "1-3s");
module_param_array(board1, charp, NULL, 0);
MODULE_PARM_DESC(board1, "Board 1 config -> name[,ioaddr[,memaddr]");
MODULE_PARM(board2, "1-3s");
module_param_array(board2, charp, NULL, 0);
MODULE_PARM_DESC(board2, "Board 2 config -> name[,ioaddr[,memaddr]");
MODULE_PARM(board3, "1-3s");
module_param_array(board3, charp, NULL, 0);
MODULE_PARM_DESC(board3, "Board 3 config -> name[,ioaddr[,memaddr]");

#endif
Expand Down
8 changes: 4 additions & 4 deletions drivers/char/mxser.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,10 +243,10 @@ static int verbose = 0;

MODULE_AUTHOR("Casper Yang");
MODULE_DESCRIPTION("MOXA Smartio/Industio Family Multiport Board Device Driver");
MODULE_PARM(ioaddr, "1-4i");
MODULE_PARM(ttymajor, "i");
MODULE_PARM(calloutmajor, "i");
MODULE_PARM(verbose, "i");
module_param_array(ioaddr, int, NULL, 0);
module_param(ttymajor, int, 0);
module_param(calloutmajor, int, 0);
module_param(verbose, bool, 0);
MODULE_LICENSE("GPL");

struct mxser_log {
Expand Down
8 changes: 4 additions & 4 deletions drivers/char/riscom8.c
Original file line number Diff line number Diff line change
Expand Up @@ -1743,10 +1743,10 @@ static int iobase;
static int iobase1;
static int iobase2;
static int iobase3;
MODULE_PARM(iobase, "i");
MODULE_PARM(iobase1, "i");
MODULE_PARM(iobase2, "i");
MODULE_PARM(iobase3, "i");
module_param(iobase, int, 0);
module_param(iobase1, int, 0);
module_param(iobase2, int, 0);
module_param(iobase3, int, 0);

MODULE_LICENSE("GPL");
#endif /* MODULE */
Expand Down
2 changes: 1 addition & 1 deletion drivers/isdn/hardware/avm/b1dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ MODULE_AUTHOR("Carsten Paeth");
MODULE_LICENSE("GPL");

static int suppress_pollack = 0;
MODULE_PARM(suppress_pollack, "0-1i");
module_param(suppress_pollack, bool, 0);

/* ------------------------------------------------------------- */

Expand Down
4 changes: 2 additions & 2 deletions drivers/isdn/hardware/avm/b1isa.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ static struct pci_dev isa_dev[MAX_CARDS];
static int io[MAX_CARDS];
static int irq[MAX_CARDS];

MODULE_PARM(io, "1-" __MODULE_STRING(MAX_CARDS) "i");
MODULE_PARM(irq, "1-" __MODULE_STRING(MAX_CARDS) "i");
module_param_array(io, int, NULL, 0);
module_param_array(irq, int, NULL, 0);
MODULE_PARM_DESC(io, "I/O base address(es)");
MODULE_PARM_DESC(irq, "IRQ number(s) (assigned)");

Expand Down
2 changes: 1 addition & 1 deletion drivers/isdn/hardware/avm/c4.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ MODULE_DEVICE_TABLE(pci, c4_pci_tbl);
MODULE_DESCRIPTION("CAPI4Linux: Driver for AVM C2/C4 cards");
MODULE_AUTHOR("Carsten Paeth");
MODULE_LICENSE("GPL");
MODULE_PARM(suppress_pollack, "0-1i");
module_param(suppress_pollack, bool, 0);

/* ------------------------------------------------------------- */

Expand Down
6 changes: 3 additions & 3 deletions drivers/isdn/hardware/avm/t1isa.c
Original file line number Diff line number Diff line change
Expand Up @@ -519,9 +519,9 @@ static int io[MAX_CARDS];
static int irq[MAX_CARDS];
static int cardnr[MAX_CARDS];

MODULE_PARM(io, "1-" __MODULE_STRING(MAX_CARDS) "i");
MODULE_PARM(irq, "1-" __MODULE_STRING(MAX_CARDS) "i");
MODULE_PARM(cardnr, "1-" __MODULE_STRING(MAX_CARDS) "i");
module_param_array(io, int, NULL, 0);
module_param_array(irq, int, NULL, 0);
module_param_array(cardnr, int, NULL, 0);
MODULE_PARM_DESC(io, "I/O base address(es)");
MODULE_PARM_DESC(irq, "IRQ number(s) (assigned)");
MODULE_PARM_DESC(cardnr, "Card number(s) (as jumpered)");
Expand Down
2 changes: 1 addition & 1 deletion drivers/isdn/hysdn/hycapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
static char hycapi_revision[]="$Revision: 1.8.6.4 $";

unsigned int hycapi_enable = 0xffffffff;
MODULE_PARM(hycapi_enable, "i");
module_param(hycapi_enable, uint, 0);

typedef struct _hycapi_appl {
unsigned int ctrl_mask;
Expand Down
2 changes: 1 addition & 1 deletion drivers/isdn/hysdn/hysdn_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include "hysdn_defs.h"

unsigned int hynet_enable = 0xffffffff;
MODULE_PARM(hynet_enable, "i");
module_param(hynet_enable, uint, 0);

/* store the actual version for log reporting */
char *hysdn_net_revision = "$Revision: 1.8.6.4 $";
Expand Down
2 changes: 1 addition & 1 deletion drivers/isdn/isdnloop/isdnloop.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ static char *isdnloop_id = "loop0";
MODULE_DESCRIPTION("ISDN4Linux: Pseudo Driver that simulates an ISDN card");
MODULE_AUTHOR("Fritz Elfert");
MODULE_LICENSE("GPL");
MODULE_PARM(isdnloop_id, "s");
module_param(isdnloop_id, charp, 0);
MODULE_PARM_DESC(isdnloop_id, "ID-String of first card");

static int isdnloop_addcard(char *);
Expand Down
8 changes: 4 additions & 4 deletions drivers/media/video/zr36120.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ MODULE_AUTHOR("Pauline Middelink <[email protected]>");
MODULE_DESCRIPTION("Zoran ZR36120 based framegrabber");
MODULE_LICENSE("GPL");

MODULE_PARM(triton1,"i");
MODULE_PARM(cardtype,"1-" __MODULE_STRING(ZORAN_MAX) "i");
MODULE_PARM(video_nr,"i");
MODULE_PARM(vbi_nr,"i");
module_param(triton1, uint, 0);
module_param_array(cardtype, uint, NULL, 0);
module_param(video_nr, int, 0);
module_param(vbi_nr, int, 0);

static int zoran_cards;
static struct zoran zorans[ZORAN_MAX];
Expand Down
2 changes: 1 addition & 1 deletion drivers/mmc/au1xmmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ struct au1xmmc_host *au1xmmc_hosts[AU1XMMC_CONTROLLER_COUNT];
static int dma = 1;

#ifdef MODULE
MODULE_PARM(dma, "i");
module_param(dma, bool, 0);
MODULE_PARM_DESC(dma, "Use DMA engine for data transfers (0 = disabled)");
#endif

Expand Down
14 changes: 7 additions & 7 deletions drivers/mtd/maps/pcmciamtd.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

#ifdef CONFIG_MTD_DEBUG
static int debug = CONFIG_MTD_DEBUG_VERBOSE;
MODULE_PARM(debug, "i");
module_param(debug, int, 0);
MODULE_PARM_DESC(debug, "Set Debug Level 0=quiet, 5=noisy");
#undef DEBUG
#define DEBUG(n, format, arg...) \
Expand Down Expand Up @@ -89,17 +89,17 @@ static int mem_type;
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Simon Evans <[email protected]>");
MODULE_DESCRIPTION(DRIVER_DESC);
MODULE_PARM(bankwidth, "i");
module_param(bankwidth, int, 0);
MODULE_PARM_DESC(bankwidth, "Set bankwidth (1=8 bit, 2=16 bit, default=2)");
MODULE_PARM(mem_speed, "i");
module_param(mem_speed, int, 0);
MODULE_PARM_DESC(mem_speed, "Set memory access speed in ns");
MODULE_PARM(force_size, "i");
module_param(force_size, int, 0);
MODULE_PARM_DESC(force_size, "Force size of card in MiB (1-64)");
MODULE_PARM(setvpp, "i");
module_param(setvpp, int, 0);
MODULE_PARM_DESC(setvpp, "Set Vpp (0=Never, 1=On writes, 2=Always on, default=0)");
MODULE_PARM(vpp, "i");
module_param(vpp, int, 0);
MODULE_PARM_DESC(vpp, "Vpp value in 1/10ths eg 33=3.3V 120=12V (Dangerous)");
MODULE_PARM(mem_type, "i");
module_param(mem_type, int, 0);
MODULE_PARM_DESC(mem_type, "Set Memory type (0=Flash, 1=RAM, 2=ROM, default=0)");


Expand Down
2 changes: 1 addition & 1 deletion drivers/net/atari_bionet.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ static char version[] =
* Global variable 'bionet_debug'. Can be set at load time by 'insmod'
*/
unsigned int bionet_debug = NET_DEBUG;
MODULE_PARM(bionet_debug, "i");
module_param(bionet_debug, int, 0);
MODULE_PARM_DESC(bionet_debug, "bionet debug level (0-2)");
MODULE_LICENSE("GPL");

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/atari_pamsnet.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ static char *version =
* Global variable 'pamsnet_debug'. Can be set at load time by 'insmod'
*/
unsigned int pamsnet_debug = NET_DEBUG;
MODULE_PARM(pamsnet_debug, "i");
module_param(pamsnet_debug, int, 0);
MODULE_PARM_DESC(pamsnet_debug, "pamsnet debug enable (0-1)");
MODULE_LICENSE("GPL");

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/atarilance.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ static int lance_debug = LANCE_DEBUG;
#else
static int lance_debug = 1;
#endif
MODULE_PARM(lance_debug, "i");
module_param(lance_debug, int, 0);
MODULE_PARM_DESC(lance_debug, "atarilance debug level (0-3)");
MODULE_LICENSE("GPL");

Expand Down
11 changes: 6 additions & 5 deletions drivers/net/cassini.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,12 +192,15 @@
static char version[] __devinitdata =
DRV_MODULE_NAME ".c:v" DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n";

static int cassini_debug = -1; /* -1 == use CAS_DEF_MSG_ENABLE as value */
static int link_mode;

MODULE_AUTHOR("Adrian Sun ([email protected])");
MODULE_DESCRIPTION("Sun Cassini(+) ethernet driver");
MODULE_LICENSE("GPL");
MODULE_PARM(cassini_debug, "i");
module_param(cassini_debug, int, 0);
MODULE_PARM_DESC(cassini_debug, "Cassini bitmapped debugging message enable value");
MODULE_PARM(link_mode, "i");
module_param(link_mode, int, 0);
MODULE_PARM_DESC(link_mode, "default link mode");

/*
Expand All @@ -209,7 +212,7 @@ MODULE_PARM_DESC(link_mode, "default link mode");
* Value in seconds, for user input.
*/
static int linkdown_timeout = DEFAULT_LINKDOWN_TIMEOUT;
MODULE_PARM(linkdown_timeout, "i");
module_param(linkdown_timeout, int, 0);
MODULE_PARM_DESC(linkdown_timeout,
"min reset interval in sec. for PCS linkdown issue; disabled if not positive");

Expand All @@ -221,8 +224,6 @@ MODULE_PARM_DESC(linkdown_timeout,
static int link_transition_timeout;


static int cassini_debug = -1; /* -1 == use CAS_DEF_MSG_ENABLE as value */
static int link_mode;

static u16 link_modes[] __devinitdata = {
BMCR_ANENABLE, /* 0 : autoneg */
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/chelsio/cxgb2.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ MODULE_LICENSE("GPL");

static int dflt_msg_enable = DFLT_MSG_ENABLE;

MODULE_PARM(dflt_msg_enable, "i");
module_param(dflt_msg_enable, int, 0);
MODULE_PARM_DESC(dflt_msg_enable, "Chelsio T1 message enable bitmap");


Expand Down
Loading

0 comments on commit 8d3b33f

Please sign in to comment.