Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1544052 > unrolled thread

[PATCH] net: wireless: marvell: libertas: constify cfg80211_ops structures

Started byBhumika Goyal <bhumirks@gmail.com>
First post2016-12-18 00:00 +0100
Last post2016-12-30 15:00 +0100
Articles 3 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] net: wireless: marvell: libertas: constify cfg80211_ops structures Bhumika Goyal <bhumirks@gmail.com> - 2016-12-18 00:00 +0100
    Re: net: wireless: marvell: libertas: constify cfg80211_ops structures Kalle Valo <kvalo@codeaurora.org> - 2016-12-30 14:10 +0100
    Re: libertas: constify cfg80211_ops structures Kalle Valo <kvalo@codeaurora.org> - 2016-12-30 15:00 +0100

#1544052 — [PATCH] net: wireless: marvell: libertas: constify cfg80211_ops structures

FromBhumika Goyal <bhumirks@gmail.com>
Date2016-12-18 00:00 +0100
Subject[PATCH] net: wireless: marvell: libertas: constify cfg80211_ops structures
Message-ID<sPw7o-7ne-17@gated-at.bofh.it>
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
  21225	   1954	     16	  23195	   5a9b	wireless/marvell/libertas/cfg.o

File size after:
   text	   data	    bss	    dec	    hex	filename
  22041	   1154	     16	  23211	   5aab	wireless/marvell/libertas/cfg.o

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
---
 drivers/net/wireless/marvell/libertas/cfg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/marvell/libertas/cfg.c b/drivers/net/wireless/marvell/libertas/cfg.c
index 7ff2efa..3f97acb 100644
--- a/drivers/net/wireless/marvell/libertas/cfg.c
+++ b/drivers/net/wireless/marvell/libertas/cfg.c
@@ -2086,7 +2086,7 @@ static int lbs_set_power_mgmt(struct wiphy *wiphy, struct net_device *dev,
  * Initialization
  */
 
-static struct cfg80211_ops lbs_cfg80211_ops = {
+static const struct cfg80211_ops lbs_cfg80211_ops = {
 	.set_monitor_channel = lbs_cfg_set_monitor_channel,
 	.libertas_set_mesh_channel = lbs_cfg_set_mesh_channel,
 	.scan = lbs_cfg_scan,
-- 
1.9.1

[toc] | [next] | [standalone]


#1548581 — Re: net: wireless: marvell: libertas: constify cfg80211_ops structures

FromKalle Valo <kvalo@codeaurora.org>
Date2016-12-30 14:10 +0100
SubjectRe: net: wireless: marvell: libertas: constify cfg80211_ops structures
Message-ID<sU56x-4KU-17@gated-at.bofh.it>
In reply to#1544052
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
>   21225	   1954	     16	  23195	   5a9b	wireless/marvell/libertas/cfg.o
> 
> File size after:
>    text	   data	    bss	    dec	    hex	filename
>   22041	   1154	     16	  23211	   5aab	wireless/marvell/libertas/cfg.o
> 
> Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>

The prefix should be "libertas:", I can fix that before I commit.

-- 
https://patchwork.kernel.org/patch/9479131/

Documentation about submitting wireless patches and checking status
from patchwork:

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

[toc] | [prev] | [next] | [standalone]


#1548598 — Re: libertas: constify cfg80211_ops structures

FromKalle Valo <kvalo@codeaurora.org>
Date2016-12-30 15:00 +0100
SubjectRe: libertas: constify cfg80211_ops structures
Message-ID<sU5SV-54a-3@gated-at.bofh.it>
In reply to#1544052
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
>   21225	   1954	     16	  23195	   5a9b	wireless/marvell/libertas/cfg.o
> 
> File size after:
>    text	   data	    bss	    dec	    hex	filename
>   22041	   1154	     16	  23211	   5aab	wireless/marvell/libertas/cfg.o
> 
> Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>

Patch applied to wireless-drivers-next.git, thanks.

26eb994d5239 libertas: constify cfg80211_ops structures

-- 
https://patchwork.kernel.org/patch/9479131/

Documentation about submitting wireless patches and checking status
from patchwork:

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web