Skip to content

Commit

Permalink
Staging: rtlwifi: remove unnecessary NULL check
Browse files Browse the repository at this point in the history
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: ClangBuiltLinux#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>
  • Loading branch information
nishanthkarthik authored and gregkh committed Sep 25, 2018
1 parent f007d90 commit f986978
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/staging/rtlwifi/regd.c
Expand Up @@ -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 */
Expand Down

0 comments on commit f986978

Please sign in to comment.