提交 e6e0a035 编写于 作者: N Nathan Chancellor 提交者: Greg Kroah-Hartman

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 deabe035 ("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/487Signed-off-by: NNathan Chancellor <natechancellor@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 3df7e8a7
......@@ -2659,8 +2659,7 @@ static int ieee80211_wpa_set_wpa_ie(struct ieee80211_device *ieee,
{
u8 *buf;
if (param->u.wpa_ie.len > MAX_WPA_IE_LEN ||
(param->u.wpa_ie.len && !param->u.wpa_ie.data))
if (param->u.wpa_ie.len > MAX_WPA_IE_LEN)
return -EINVAL;
if (param->u.wpa_ie.len) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册