staging: wlan-ng: remove unused variable
authorAya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Fri, 27 Feb 2015 12:50:34 +0000 (14:50 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 2 Mar 2015 00:23:55 +0000 (16:23 -0800)
This patch removes variables that were simply used to
store the return value of a function call before
returning it.

The issue was detected and resolved using the following
coccinelle script:

@@
identifier len,f;
@@

-int len;
 ... when != len
     when strict
-len =
+return
        f(...);
-return len;

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wlan-ng/prism2mib.c

index 0163e062b650810b9310bf5faefde96be2972ee8..b4a15ef3a405ce78bb0044aeff03a86f566da5a8 100644 (file)
@@ -582,8 +582,6 @@ static int prism2mib_privacyinvoked(struct mibrec *mib,
                                    struct p80211msg_dot11req_mibset *msg,
                                    void *data)
 {
-       int result;
-
        if (wlandev->hostwep & HOSTWEP_DECRYPT) {
                if (wlandev->hostwep & HOSTWEP_DECRYPT)
                        mib->parm2 |= HFA384x_WEPFLAGS_DISABLE_RXCRYPT;
@@ -591,9 +589,7 @@ static int prism2mib_privacyinvoked(struct mibrec *mib,
                        mib->parm2 |= HFA384x_WEPFLAGS_DISABLE_TXCRYPT;
        }
 
-       result = prism2mib_flag(mib, isget, wlandev, hw, msg, data);
-
-       return result;
+       return prism2mib_flag(mib, isget, wlandev, hw, msg, data);
 }
 
 /*----------------------------------------------------------------
@@ -628,11 +624,8 @@ static int prism2mib_excludeunencrypted(struct mibrec *mib,
                                        struct p80211msg_dot11req_mibset *msg,
                                        void *data)
 {
-       int result;
-
-       result = prism2mib_flag(mib, isget, wlandev, hw, msg, data);
 
-       return result;
+       return prism2mib_flag(mib, isget, wlandev, hw, msg, data);
 }
 
 /*----------------------------------------------------------------