* [PATCH] net: wireless: ath: wil6210: constify cfg80211_ops structures
@ 2016-12-17 22:44 Bhumika Goyal
2016-12-30 13:01 ` Kalle Valo
2017-01-12 10:55 ` Kalle Valo
0 siblings, 2 replies; 3+ messages in thread
From: Bhumika Goyal @ 2016-12-17 22:44 UTC (permalink / raw)
To: julia.lawall, qca_merez, kvalo, linux-wireless, wil6210, netdev,
linux-kernel
Cc: Bhumika Goyal
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 <bhumirks@gmail.com>
---
drivers/net/wireless/ath/wil6210/cfg80211.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/ath/wil6210/cfg80211.c b/drivers/net/wireless/ath/wil6210/cfg80211.c
index 6aa3ff4..54dd116 100644
--- a/drivers/net/wireless/ath/wil6210/cfg80211.c
+++ b/drivers/net/wireless/ath/wil6210/cfg80211.c
@@ -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,
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: net: wireless: ath: wil6210: constify cfg80211_ops structures
2016-12-17 22:44 [PATCH] net: wireless: ath: wil6210: constify cfg80211_ops structures Bhumika Goyal
@ 2016-12-30 13:01 ` Kalle Valo
2017-01-12 10:55 ` Kalle Valo
1 sibling, 0 replies; 3+ messages in thread
From: Kalle Valo @ 2016-12-30 13:01 UTC (permalink / raw)
To: Bhumika Goyal
Cc: julia.lawall, qca_merez, linux-wireless, wil6210, netdev,
linux-kernel, Bhumika Goyal
Bhumika Goyal <bhumirks@gmail.com> wrote:
> 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 <bhumirks@gmail.com>
The prefix should be "wil6210:", I can fix that before I commit this.
--
https://patchwork.kernel.org/patch/9479127/
Documentation about submitting wireless patches and checking status
from patchwork:
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: net: wireless: ath: wil6210: constify cfg80211_ops structures
2016-12-17 22:44 [PATCH] net: wireless: ath: wil6210: constify cfg80211_ops structures Bhumika Goyal
2016-12-30 13:01 ` Kalle Valo
@ 2017-01-12 10:55 ` Kalle Valo
1 sibling, 0 replies; 3+ messages in thread
From: Kalle Valo @ 2017-01-12 10:55 UTC (permalink / raw)
To: Bhumika Goyal
Cc: julia.lawall, qca_merez, kvalo, linux-wireless, wil6210, netdev,
linux-kernel, Bhumika Goyal
Bhumika Goyal <bhumirks@gmail.com> wrote:
> 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 <bhumirks@gmail.com>
Patch applied to ath-next branch of ath.git, thanks.
b59eb96181e7 wil6210: constify cfg80211_ops structures
--
https://patchwork.kernel.org/patch/9479127/
Documentation about submitting wireless patches and checking status
from patchwork:
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-01-12 10:55 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-17 22:44 [PATCH] net: wireless: ath: wil6210: constify cfg80211_ops structures Bhumika Goyal
2016-12-30 13:01 ` Kalle Valo
2017-01-12 10:55 ` Kalle Valo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).