diff mbox

[OPW,kernel] staging:rtl8187se:ieee80211: fix unused variable warning

Message ID 20140308231507.GA29889@himangi-Inspiron-N5110gmail.com
State New, archived
Headers show

Commit Message

HIMANGI SARAOGI March 8, 2014, 11:15 p.m. UTC
This patch fixes the sparse warning:
drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c:27:11: warning: ‘rsn_authen_cipher_suite’ defined but not used [-Wunused-variable]
by marking the variable as __maybe_unused.
Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
---
 .../rtl8187se/ieee80211/ieee80211_softmac.c        |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Greg KH March 8, 2014, 11:19 p.m. UTC | #1
On Sun, Mar 09, 2014 at 04:45:07AM +0530, Himangi Saraogi wrote:
> This patch fixes the sparse warning:
> drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c:27:11: warning: ‘rsn_authen_cipher_suite’ defined but not used [-Wunused-variable]
> by marking the variable as __maybe_unused.
> Signed-off-by: Himangi Saraogi <himangi774@gmail.com>

You need an empty line before the Signed-off-by: line :(
Josh Triplett March 9, 2014, 12:19 a.m. UTC | #2
On Sun, Mar 09, 2014 at 04:45:07AM +0530, Himangi Saraogi wrote:
> This patch fixes the sparse warning:
> drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c:27:11: warning: ‘rsn_authen_cipher_suite’ defined but not used [-Wunused-variable]
> by marking the variable as __maybe_unused.
> Signed-off-by: Himangi Saraogi <himangi774@gmail.com>

Does anything *ever* use rsn_authen_cipher_suite?  If nothing does, it
should go away completely.  If something does under some circumstances,
then the commit message should explain that in detail.  And ideally, in
that case, you should determine under which circumstances (e.g. CONFIG_*
options) it gets used, and arrange to not define it when unused.

>  .../rtl8187se/ieee80211/ieee80211_softmac.c        |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c b/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c
> index ab3efe9..5ab76ba 100644
> --- a/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c
> +++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c
> @@ -24,7 +24,7 @@
>  #include <linux/etherdevice.h>
>  
>  #include "dot11d.h"
> -static u8 rsn_authen_cipher_suite[16][4] = {
> +static u8 rsn_authen_cipher_suite[16][4] __maybe_unused = {
>  	{0x00, 0x0F, 0xAC, 0x00}, //Use group key, //Reserved
>  	{0x00, 0x0F, 0xAC, 0x01}, //WEP-40         //RSNA default
>  	{0x00, 0x0F, 0xAC, 0x02}, //TKIP           //NONE		//{used just as default}
> -- 
> 1.7.9.5
> 
> -- 
> You received this message because you are subscribed to the Google Groups "opw-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to opw-kernel+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
diff mbox

Patch

diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c b/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c
index ab3efe9..5ab76ba 100644
--- a/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c
+++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c
@@ -24,7 +24,7 @@ 
 #include <linux/etherdevice.h>
 
 #include "dot11d.h"
-static u8 rsn_authen_cipher_suite[16][4] = {
+static u8 rsn_authen_cipher_suite[16][4] __maybe_unused = {
 	{0x00, 0x0F, 0xAC, 0x00}, //Use group key, //Reserved
 	{0x00, 0x0F, 0xAC, 0x01}, //WEP-40         //RSNA default
 	{0x00, 0x0F, 0xAC, 0x02}, //TKIP           //NONE		//{used just as default}