Skip to content

Commit

Permalink
module_param: make bool parameters really bool (net & drivers/net)
Browse files Browse the repository at this point in the history
module_param(bool) used to counter-intuitively take an int.  In
fddd520 (mid-2009) we allowed bool or int/unsigned int using a messy
trick.

It's time to remove the int/unsigned int option.  For this version
it'll simply give a warning, but it'll break next kernel version.

(Thanks to Joe Perches for suggesting coccinelle for 0/1 -> true/false).

Cc: "David S. Miller" <[email protected]>
Cc: [email protected]
Signed-off-by: Rusty Russell <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
rustyrussell authored and davem330 committed Dec 20, 2011
1 parent 3db1cd5 commit eb93992
Show file tree
Hide file tree
Showing 52 changed files with 64 additions and 63 deletions.
6 changes: 3 additions & 3 deletions drivers/net/caif/caif_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ MODULE_ALIAS_LDISC(N_CAIF);
/*This list is protected by the rtnl lock. */
static LIST_HEAD(ser_list);

static int ser_loop;
static bool ser_loop;
module_param(ser_loop, bool, S_IRUGO);
MODULE_PARM_DESC(ser_loop, "Run in simulated loopback mode.");

static int ser_use_stx = 1;
static bool ser_use_stx = true;
module_param(ser_use_stx, bool, S_IRUGO);
MODULE_PARM_DESC(ser_use_stx, "STX enabled or not.");

static int ser_use_fcs = 1;
static bool ser_use_fcs = true;

module_param(ser_use_fcs, bool, S_IRUGO);
MODULE_PARM_DESC(ser_use_fcs, "FCS enabled or not.");
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/caif/caif_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ MODULE_DESCRIPTION("CAIF SPI driver");
/* Returns the number of padding bytes for alignment. */
#define PAD_POW2(x, pow) ((((x)&((pow)-1))==0) ? 0 : (((pow)-((x)&((pow)-1)))))

static int spi_loop;
static bool spi_loop;
module_param(spi_loop, bool, S_IRUGO);
MODULE_PARM_DESC(spi_loop, "SPI running in loopback mode.");

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/can/vcan.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ MODULE_AUTHOR("Urs Thuermann <[email protected]>");
* See Documentation/networking/can.txt for details.
*/

static int echo; /* echo testing. Default: 0 (Off) */
static bool echo; /* echo testing. Default: 0 (Off) */
module_param(echo, bool, S_IRUGO);
MODULE_PARM_DESC(echo, "Echo sent frames (for testing). Default: 0 (Off)");

Expand Down
4 changes: 2 additions & 2 deletions drivers/net/ethernet/amd/amd8111e.h
Original file line number Diff line number Diff line change
Expand Up @@ -807,8 +807,8 @@ typedef enum {

static int card_idx;
static int speed_duplex[MAX_UNITS] = { 0, };
static int coalesce[MAX_UNITS] = {1,1,1,1,1,1,1,1};
static int dynamic_ipg[MAX_UNITS] = {0,0,0,0,0,0,0,0};
static bool coalesce[MAX_UNITS] = { [ 0 ... MAX_UNITS-1] = true };
static bool dynamic_ipg[MAX_UNITS] = { [ 0 ... MAX_UNITS-1] = false };
static unsigned int chip_version;

#endif /* _AMD8111E_H */
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ module_param_array(intr_cnt, uint, NULL, 0644);
MODULE_PARM_DESC(intr_cnt,
"thresholds 1..3 for queue interrupt packet counters");

static int vf_acls;
static bool vf_acls;

#ifdef CONFIG_PCI_IOV
module_param(vf_acls, bool, 0644);
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/dlink/de600.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ static const char version[] = "de600.c: $Revision: 1.41-2.5 $, Bjorn Ekwall (bj

#include "de600.h"

static unsigned int check_lost = 1;
static bool check_lost = true;
module_param(check_lost, bool, 0);
MODULE_PARM_DESC(check_lost, "If set then check for unplugged de600");

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/mellanox/mlx4/fw.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ enum {
extern void __buggy_use_of_MLX4_GET(void);
extern void __buggy_use_of_MLX4_PUT(void);

static int enable_qos;
static bool enable_qos;
module_param(enable_qos, bool, 0444);
MODULE_PARM_DESC(enable_qos, "Enable Quality of Service support in the HCA (default: off)");

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/mellanox/mlx4/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ MODULE_PARM_DESC(log_num_vlan, "Log2 max number of VLANs per ETH port (0-7)");
/* Log2 max number of VLANs per ETH port (0-7) */
#define MLX4_LOG_NUM_VLANS 7

static int use_prio;
static bool use_prio;
module_param_named(use_prio, use_prio, bool, 0444);
MODULE_PARM_DESC(use_prio, "Enable steering by VLAN priority on ETH ports "
"(0/1, default 0)");
Expand Down
5 changes: 3 additions & 2 deletions drivers/net/ethernet/via/via-rhine.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#define DRV_VERSION "1.5.0"
#define DRV_RELDATE "2010-10-09"

#include <linux/types.h>

/* A few user-configurable values.
These may be modified when a driver module is loaded. */
Expand All @@ -55,7 +56,7 @@ static int rx_copybreak;

/* Work-around for broken BIOSes: they are unable to get the chip back out of
power state D3 so PXE booting fails. bootparam(7): via-rhine.avoid_D3=1 */
static int avoid_D3;
static bool avoid_D3;

/*
* In case you are looking for 'options[]' or 'full_duplex[]', they
Expand Down Expand Up @@ -2322,7 +2323,7 @@ static int __init rhine_init(void)
#endif
if (dmi_check_system(rhine_dmi_table)) {
/* these BIOSes fail at PXE boot if chip is in D3 */
avoid_D3 = 1;
avoid_D3 = true;
pr_warn("Broken BIOS detected, avoid_D3 enabled\n");
}
else if (avoid_D3)
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/irda/donauboe.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ static char *driver_name = DRIVER_NAME;

static int max_baud = 4000000;
#ifdef USE_PROBE
static int do_probe = 0;
static bool do_probe = false;
#endif


Expand Down
2 changes: 1 addition & 1 deletion drivers/net/irda/smsc-ircc2.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ MODULE_AUTHOR("Daniele Peri <[email protected]>");
MODULE_DESCRIPTION("SMC IrCC SIR/FIR controller driver");
MODULE_LICENSE("GPL");

static int smsc_nopnp = 1;
static bool smsc_nopnp = true;
module_param_named(nopnp, smsc_nopnp, bool, 0);
MODULE_PARM_DESC(nopnp, "Do not use PNP to detect controller settings, defaults to true");

Expand Down
4 changes: 2 additions & 2 deletions drivers/net/usb/pegasus.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ static const char driver_name[] = "pegasus";
#define BMSR_MEDIA (BMSR_10HALF | BMSR_10FULL | BMSR_100HALF | \
BMSR_100FULL | BMSR_ANEGCAPABLE)

static int loopback;
static int mii_mode;
static bool loopback;
static bool mii_mode;
static char *devid;

static struct usb_eth_dev usb_dev_id[] = {
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/usb/smsc75xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ struct usb_context {
struct usbnet *dev;
};

static int turbo_mode = true;
static bool turbo_mode = true;
module_param(turbo_mode, bool, 0644);
MODULE_PARM_DESC(turbo_mode, "Enable multiple frames per Rx transaction");

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/usb/smsc95xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ struct usb_context {
struct usbnet *dev;
};

static int turbo_mode = true;
static bool turbo_mode = true;
module_param(turbo_mode, bool, 0644);
MODULE_PARM_DESC(turbo_mode, "Enable multiple frames per Rx transaction");

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/virtio_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
static int napi_weight = 128;
module_param(napi_weight, int, 0444);

static int csum = 1, gso = 1;
static bool csum = true, gso = true;
module_param(csum, bool, 0444);
module_param(gso, bool, 0444);

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wan/sbni.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ static int emancipate( struct net_device * );
static const char version[] =
"Granch SBNI12 driver ver 5.0.1 Jun 22 2001 Denis I.Timofeev.\n";

static int skip_pci_probe __initdata = 0;
static bool skip_pci_probe __initdata = false;
static int scandone __initdata = 0;
static int num __initdata = 0;

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wan/sealevel.c
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ static int io=0x238;
static int txdma=1;
static int rxdma=3;
static int irq=5;
static int slow=0;
static bool slow=false;

module_param(io, int, 0);
MODULE_PARM_DESC(io, "The I/O base of the Sealevel card");
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/ath/ath5k/ath5k.h
Original file line number Diff line number Diff line change
Expand Up @@ -914,7 +914,7 @@ enum ath5k_dmasize {
*/

#define AR5K_KEYCACHE_SIZE 8
extern int ath5k_modparam_nohwcrypt;
extern bool ath5k_modparam_nohwcrypt;

/***********************\
HW RELATED DEFINITIONS
Expand Down
6 changes: 3 additions & 3 deletions drivers/net/wireless/ath/ath5k/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,15 @@
#define CREATE_TRACE_POINTS
#include "trace.h"

int ath5k_modparam_nohwcrypt;
bool ath5k_modparam_nohwcrypt;
module_param_named(nohwcrypt, ath5k_modparam_nohwcrypt, bool, S_IRUGO);
MODULE_PARM_DESC(nohwcrypt, "Disable hardware encryption.");

static int modparam_all_channels;
static bool modparam_all_channels;
module_param_named(all_channels, modparam_all_channels, bool, S_IRUGO);
MODULE_PARM_DESC(all_channels, "Expose all channels the device can use.");

static int modparam_fastchanswitch;
static bool modparam_fastchanswitch;
module_param_named(fastchanswitch, modparam_fastchanswitch, bool, S_IRUGO);
MODULE_PARM_DESC(fastchanswitch, "Enable fast channel switching for AR2413/AR5413 radios.");

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/ath/carl9170/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
#include "carl9170.h"
#include "cmd.h"

static int modparam_nohwcrypt;
static bool modparam_nohwcrypt;
module_param_named(nohwcrypt, modparam_nohwcrypt, bool, S_IRUGO);
MODULE_PARM_DESC(nohwcrypt, "Disable hardware crypto offload.");

Expand Down
4 changes: 2 additions & 2 deletions drivers/net/wireless/iwmc3200wifi/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,11 @@ static struct iwm_conf def_iwm_conf = {
.mac_addr = {0x00, 0x02, 0xb3, 0x01, 0x02, 0x03},
};

static int modparam_reset;
static bool modparam_reset;
module_param_named(reset, modparam_reset, bool, 0644);
MODULE_PARM_DESC(reset, "reset on firmware errors (default 0 [not reset])");

static int modparam_wimax_enable = 1;
static bool modparam_wimax_enable = true;
module_param_named(wimax_enable, modparam_wimax_enable, bool, 0644);
MODULE_PARM_DESC(wimax_enable, "Enable wimax core (default 1 [wimax enabled])");

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/mwl8k.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#define MWL8K_VERSION "0.12"

/* Module parameters */
static unsigned ap_mode_default;
static bool ap_mode_default;
module_param(ap_mode_default, bool, 0);
MODULE_PARM_DESC(ap_mode_default,
"Set to 1 to make ap mode the default instead of sta mode");
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/orinoco/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ module_param(orinoco_debug, int, 0644);
MODULE_PARM_DESC(orinoco_debug, "Debug level");
#endif

static int suppress_linkstatus; /* = 0 */
static bool suppress_linkstatus; /* = 0 */
module_param(suppress_linkstatus, bool, 0644);
MODULE_PARM_DESC(suppress_linkstatus, "Don't log link status changes");

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/p54/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include "p54.h"
#include "lmac.h"

static int modparam_nohwcrypt;
static bool modparam_nohwcrypt;
module_param_named(nohwcrypt, modparam_nohwcrypt, bool, S_IRUGO);
MODULE_PARM_DESC(nohwcrypt, "Disable hardware encryption.");
MODULE_AUTHOR("Michael Wu <[email protected]>");
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/rt2x00/rt2500usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
/*
* Allow hardware encryption to be disabled.
*/
static int modparam_nohwcrypt;
static bool modparam_nohwcrypt;
module_param_named(nohwcrypt, modparam_nohwcrypt, bool, S_IRUGO);
MODULE_PARM_DESC(nohwcrypt, "Disable hardware encryption.");

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/rt2x00/rt2800pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
/*
* Allow hardware encryption to be disabled.
*/
static int modparam_nohwcrypt = 0;
static bool modparam_nohwcrypt = false;
module_param_named(nohwcrypt, modparam_nohwcrypt, bool, S_IRUGO);
MODULE_PARM_DESC(nohwcrypt, "Disable hardware encryption.");

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/rt2x00/rt2800usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
/*
* Allow hardware encryption to be disabled.
*/
static int modparam_nohwcrypt;
static bool modparam_nohwcrypt;
module_param_named(nohwcrypt, modparam_nohwcrypt, bool, S_IRUGO);
MODULE_PARM_DESC(nohwcrypt, "Disable hardware encryption.");

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/rt2x00/rt61pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
/*
* Allow hardware encryption to be disabled.
*/
static int modparam_nohwcrypt = 0;
static bool modparam_nohwcrypt = false;
module_param_named(nohwcrypt, modparam_nohwcrypt, bool, S_IRUGO);
MODULE_PARM_DESC(nohwcrypt, "Disable hardware encryption.");

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/rt2x00/rt73usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
/*
* Allow hardware encryption to be disabled.
*/
static int modparam_nohwcrypt;
static bool modparam_nohwcrypt;
module_param_named(nohwcrypt, modparam_nohwcrypt, bool, S_IRUGO);
MODULE_PARM_DESC(nohwcrypt, "Disable hardware encryption.");

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/rtlwifi/wifi.h
Original file line number Diff line number Diff line change
Expand Up @@ -1488,7 +1488,7 @@ struct rtl_intf_ops {

struct rtl_mod_params {
/* default: 0 = using hardware encryption */
int sw_crypto;
bool sw_crypto;

/* default: 0 = DBG_EMERG (0)*/
int debug;
Expand Down
2 changes: 1 addition & 1 deletion include/net/bluetooth/l2cap.h
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,7 @@ static inline __u8 __ctrl_size(struct l2cap_chan *chan)
return L2CAP_ENH_HDR_SIZE - L2CAP_HDR_SIZE;
}

extern int disable_ertm;
extern bool disable_ertm;

int l2cap_init_sockets(void);
void l2cap_cleanup_sockets(void);
Expand Down
2 changes: 1 addition & 1 deletion include/net/sctp/structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ extern struct sctp_globals {

/* Flag to indicate whether computing and verifying checksum
* is disabled. */
int checksum_disable;
bool checksum_disable;

/* Threshold for rwnd update SACKS. Receive buffer shifted this many
* bits is an indicator of when to send and window update SACK.
Expand Down
4 changes: 2 additions & 2 deletions net/bluetooth/bnep/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@

#define VERSION "1.3"

static int compress_src = 1;
static int compress_dst = 1;
static bool compress_src = true;
static bool compress_dst = true;

static LIST_HEAD(bnep_session_list);
static DECLARE_RWSEM(bnep_session_sem);
Expand Down
2 changes: 1 addition & 1 deletion net/bluetooth/hci_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
#include <net/bluetooth/bluetooth.h>
#include <net/bluetooth/hci_core.h>

static int enable_le;
static bool enable_le;

/* Handle HCI Event packets */

Expand Down
2 changes: 1 addition & 1 deletion net/bluetooth/hci_sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
#include <net/bluetooth/bluetooth.h>
#include <net/bluetooth/hci_core.h>

static int enable_mgmt;
static bool enable_mgmt;

/* ----- HCI socket interface ----- */

Expand Down
2 changes: 1 addition & 1 deletion net/bluetooth/l2cap_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
#include <net/bluetooth/l2cap.h>
#include <net/bluetooth/smp.h>

int disable_ertm;
bool disable_ertm;

static u32 l2cap_feat_mask = L2CAP_FEAT_FIXED_CHAN;
static u8 l2cap_fixed_chan[8] = { L2CAP_FC_L2CAP, };
Expand Down
4 changes: 2 additions & 2 deletions net/bluetooth/rfcomm/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@

#define VERSION "1.11"

static int disable_cfc;
static int l2cap_ertm;
static bool disable_cfc;
static bool l2cap_ertm;
static int channel_mtu = -1;
static unsigned int l2cap_mtu = RFCOMM_MAX_L2CAP_MTU;

Expand Down
2 changes: 1 addition & 1 deletion net/bluetooth/sco.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
#include <net/bluetooth/hci_core.h>
#include <net/bluetooth/sco.h>

static int disable_esco;
static bool disable_esco;

static const struct proto_ops sco_sock_ops;

Expand Down
Loading

0 comments on commit eb93992

Please sign in to comment.