Skip to content

Commit

Permalink
wil6210: constify cfg80211_ops structures
Browse files Browse the repository at this point in the history
cfg80211_ops structures are only passed as an argument to the function
wiphy_new. This argument is of type const, so cfg80211_ops strutures
having this property can be declared as const.
Done using Coccinelle

@r1 disable optional_qualifier @
identifier i;
position p;
@@
static struct cfg80211_ops i@p = {...};

@ok1@
identifier r1.i;
position p;
@@
wiphy_new(&i@p,...)

@bad@
position p!={r1.p,ok1.p};
identifier r1.i;
@@
i@p

@Depends on !bad disable optional_qualifier@
identifier r1.i;
@@
+const
struct cfg80211_ops i;

File size before:
   text	   data	    bss	    dec	    hex	filename
  18133	   6632	      0	  24765	   60bd wireless/ath/wil6210/cfg80211.o

File size after:
   text	   data	    bss	    dec	    hex	filename
  18933	   5832	      0	  24765	   60bd wireless/ath/wil6210/cfg80211.o

Signed-off-by: Bhumika Goyal <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
  • Loading branch information
goyalbhumika authored and kvalo committed Jan 12, 2017
1 parent d48b62c commit b59eb96
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/wireless/ath/wil6210/cfg80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -1499,7 +1499,7 @@ static int wil_cfg80211_set_power_mgmt(struct wiphy *wiphy,
return rc;
}

static struct cfg80211_ops wil_cfg80211_ops = {
static const struct cfg80211_ops wil_cfg80211_ops = {
.add_virtual_intf = wil_cfg80211_add_iface,
.del_virtual_intf = wil_cfg80211_del_iface,
.scan = wil_cfg80211_scan,
Expand Down

0 comments on commit b59eb96

Please sign in to comment.