diff options
author | Bhumika Goyal <bhumirks@gmail.com> | 2016-09-26 20:03:06 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-09-27 13:02:06 +0200 |
commit | 1c40429dfad97d4e8193603058915182b728c8e9 (patch) | |
tree | 2a0c276f43783e2e3b61589835a40c27c60bcd13 /drivers/staging/wilc1000 | |
parent | 4a7beb1850d23d8a396d8655195c0e211cdb2221 (diff) | |
download | blackbird-obmc-linux-1c40429dfad97d4e8193603058915182b728c8e9.tar.gz blackbird-obmc-linux-1c40429dfad97d4e8193603058915182b728c8e9.zip |
Staging: wilc1000: constify cfg80211_ops structures
Check for cfg80211_ops structures that are only passed as the first
argument to the function wiphy_new. As this argument is constant, so
cfg80211_ops structures having this property can also be declared
constant.
Done using coccinelle:
@r1 disable optional_qualifier @
identifier i;
position p;
@@
static struct cfg80211_ops i@p = {...};
@ok1@
identifier r1.i;
position p;
expression e1;
@@
wiphy_new(&i@p,e1)
@bad@
position p!={r1.p,ok1.p};
identifier r1.i;
@@
i@p
@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
static
+const
struct cfg80211_ops i={...};
@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
+const
struct cfg80211_ops i;
File size before:
text data bss dec hex filename
17468 2417 14912 34797 87ed
drivers/staging/wilc1000/wilc_wfi_cfgoperations.o
File size after:
text data bss dec hex filename
18204 1681 14912 34797 87ed
drivers/staging/wilc1000/wilc_wfi_cfgoperations.o
Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/wilc1000')
-rw-r--r-- | drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c index 2c2e8aca8305..60d8b055bb2f 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c @@ -2200,7 +2200,7 @@ static int get_tx_power(struct wiphy *wiphy, struct wireless_dev *wdev, return ret; } -static struct cfg80211_ops wilc_cfg80211_ops = { +static const struct cfg80211_ops wilc_cfg80211_ops = { .set_monitor_channel = set_channel, .scan = scan, .connect = connect, |