libertas: constify cfg80211_ops structures

Kalle Valo kvalo at codeaurora.org
Fri Dec 30 05:56:27 PST 2016


Bhumika Goyal <bhumirks at 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 at p = {...};
> 
> @ok1@
> identifier r1.i;
> position p;
> @@
> wiphy_new(&i at p,...)
> 
> @bad@
> position p!={r1.p,ok1.p};
> identifier r1.i;
> @@
> i at 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 at 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




More information about the libertas-dev mailing list