]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
Staging: rtlwifi: remove unnecessary NULL check
authorKarthik Nishanth <nishanthkarthik@live.com>
Sat, 22 Sep 2018 14:23:54 +0000 (14:23 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 25 Sep 2018 18:51:33 +0000 (20:51 +0200)
The member regd of the struct rtl_priv is true in a boolean context.

drivers/staging/rtlwifi/regd.c:413:27: warning: address of 'rtlpriv->regd' will always
      evaluate to 'true' [-Wpointer-bool-conversion]
        if (!wiphy || !&rtlpriv->regd)
                      ~ ~~~~~~~~~^~~~
1 warning generated.

Link: https://github.com/ClangBuiltLinux/linux/issues/170
Signed-off-by: Karthik Nishanth <nishanthkarthik@live.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtlwifi/regd.c

index 3afd206ce4b1857d4cb6311b11c3cd71fb71bb2d..5213ca77117581e8c7864d6029d9d28444582dd6 100644 (file)
@@ -410,7 +410,7 @@ int rtl_regd_init(struct ieee80211_hw *hw,
        struct wiphy *wiphy = hw->wiphy;
        struct country_code_to_enum_rd *country = NULL;
 
-       if (!wiphy || !&rtlpriv->regd)
+       if (!wiphy)
                return -EINVAL;
 
        /* init country_code from efuse channel plan */