From: Larry Finger Date: Wed, 4 Sep 2013 20:56:02 +0000 (-0500) Subject: staging: r8188eu: Fix smatch warnings in os_dep/ioctl_linux.c X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=dc14a626e423f6adc193a677423c259f93a74e57;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git staging: r8188eu: Fix smatch warnings in os_dep/ioctl_linux.c Smatch reports the following: drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:941 rtw_wx_set_pmkid() warn: add some parenthesis here? drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:1042 rtw_wx_get_range() warn: assigning (-78) to unsigned variable 'range->avg_qual.level' drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:2629 rtw_get_ap_info() warn: add some parenthesis here? drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:4043 rtw_rereg_nd_name() warn: add some parenthesis here? drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:4052 rtw_rereg_nd_name() warn: add some parenthesis here? The warnings calling for adding parentheses all have "if (!memcmp() == true)" and are fixed by removing the "==true" part. The warning where a negative number is stored in an unsigned variable is fixed by biasing the result by 256. Signed-off-by: Larry Finger Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c index cd4100fb3645..8aba69388dbe 100644 --- a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c +++ b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c @@ -938,7 +938,7 @@ static int rtw_wx_set_pmkid(struct net_device *dev, memcpy(strIssueBssid, pPMK->bssid.sa_data, ETH_ALEN); if (pPMK->cmd == IW_PMKSA_ADD) { DBG_88E("[rtw_wx_set_pmkid] IW_PMKSA_ADD!\n"); - if (!memcmp(strIssueBssid, strZeroMacAddress, ETH_ALEN) == true) + if (!memcmp(strIssueBssid, strZeroMacAddress, ETH_ALEN)) return ret; else ret = true; @@ -1039,7 +1039,7 @@ static int rtw_wx_get_range(struct net_device *dev, range->avg_qual.qual = 92; /* > 8% missed beacons is 'bad' */ /* TODO: Find real 'good' to 'bad' threshol value for RSSI */ - range->avg_qual.level = 20 + -98; + range->avg_qual.level = 178; /* -78 dBm */ range->avg_qual.noise = 0; range->avg_qual.updated = 7; /* Updated all three */ @@ -2626,7 +2626,7 @@ static int rtw_get_ap_info(struct net_device *dev, return -EINVAL; } - if (!memcmp(bssid, pnetwork->network.MacAddress, ETH_ALEN) == true) { + if (!memcmp(bssid, pnetwork->network.MacAddress, ETH_ALEN)) { /* BSSID match, then check if supporting wpa/wpa2 */ DBG_88E("BSSID:%pM\n", (bssid)); @@ -4040,7 +4040,7 @@ static int rtw_rereg_nd_name(struct net_device *dev, if (0 != ret) goto exit; - if (!memcmp(rereg_priv->old_ifname, "disable%d", 9) == true) { + if (!memcmp(rereg_priv->old_ifname, "disable%d", 9)) { padapter->ledpriv.bRegUseLed = rereg_priv->old_bRegUseLed; rtw_hal_sw_led_init(padapter); rtw_ips_mode_req(&padapter->pwrctrlpriv, rereg_priv->old_ips_mode); @@ -4049,7 +4049,7 @@ static int rtw_rereg_nd_name(struct net_device *dev, strncpy(rereg_priv->old_ifname, new_ifname, IFNAMSIZ); rereg_priv->old_ifname[IFNAMSIZ-1] = 0; - if (!memcmp(new_ifname, "disable%d", 9) == true) { + if (!memcmp(new_ifname, "disable%d", 9)) { DBG_88E("%s disable\n", __func__); /* free network queue for Android's timming issue */ rtw_free_network_queue(padapter, true);