]> git.baikalelectronics.ru Git - kernel.git/commit
staging: rtl8192u: Remove an unnecessary NULL check
authorNathan Chancellor <natechancellor@gmail.com>
Tue, 21 May 2019 17:42:21 +0000 (10:42 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 May 2019 12:45:36 +0000 (14:45 +0200)
commit7f389e186d7a445fe16cbd19a52311ddb9db266f
tree3d0519bdd1f83835d49c2acea8428b244ab8d1c2
parent53c6f3103e65b31a0aa837d09a10004440394cfb
staging: rtl8192u: Remove an unnecessary NULL check

Clang warns:

drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:2663:47: warning:
address of array 'param->u.wpa_ie.data' will always evaluate to 'true'
[-Wpointer-bool-conversion]
            (param->u.wpa_ie.len && !param->u.wpa_ie.data))
                                    ~~~~~~~~~~~~~~~~~^~~~

This was exposed by commit a5a557c44a4f ("Staging: rtl8192u: ieee80211:
Use !x in place of NULL comparisons") because we disable the warning
that would have pointed out the comparison against NULL is also false:

drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:2663:46: warning:
comparison of array 'param->u.wpa_ie.data' equal to a null pointer is
always false [-Wtautological-pointer-compare]
            (param->u.wpa_ie.len && param->u.wpa_ie.data == NULL))
                                    ~~~~~~~~~~~~~~~~^~~~    ~~~~

Remove it so clang no longer warns.

Link: https://github.com/ClangBuiltLinux/linux/issues/487
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c