From: Vihas Makwana Date: Tue, 17 May 2022 14:06:26 +0000 (+0530) Subject: staging: r8188eu: fix warnings in rtw_wlan_util X-Git-Tag: v5.19-rc1~48^2~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=455d5f02dc23f4e7a298b1f4acb5dc5457e08801;p=thirdparty%2Flinux.git staging: r8188eu: fix warnings in rtw_wlan_util Refactor the code to fix following warnings: WARNING: Comparisons should place the constant on the right side of the test CHECK: Comparison to NULL could be written "p" Signed-off-by: Vihas Makwana Link: https://lore.kernel.org/r/20220517140626.3716-4-makvihas@gmail.com Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/r8188eu/core/rtw_wlan_util.c b/drivers/staging/r8188eu/core/rtw_wlan_util.c index 7caf6a4a4d175..392a65783f324 100644 --- a/drivers/staging/r8188eu/core/rtw_wlan_util.c +++ b/drivers/staging/r8188eu/core/rtw_wlan_util.c @@ -964,7 +964,7 @@ int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len) else hidden_ssid = false; - if ((NULL != p) && (false == hidden_ssid && (*(p + 1)))) { + if (p && (!hidden_ssid && (*(p + 1)))) { memcpy(bssid->Ssid.Ssid, (p + 2), *(p + 1)); bssid->Ssid.SsidLength = *(p + 1); } else {