summaryrefslogtreecommitdiff
path: root/drivers/staging/rtl8723bs/os_dep
diff options
context:
space:
mode:
authorEmily Peri <eperi1024@gmail.com>2022-10-28 21:39:19 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-10-31 11:04:18 +0300
commit2fe5dc3dcc2920669217e3696ec15fec6630a92f (patch)
treefa94386ac44c5eb1434fe48b85fdbef517d1cdc7 /drivers/staging/rtl8723bs/os_dep
parent8cd75652300f957066b86e4ede5525c756fe7a42 (diff)
downloadlinux-2fe5dc3dcc2920669217e3696ec15fec6630a92f.tar.xz
staging: rtl8723bs: replace ternary statement with min_t macro
Ternary statements that pick the min of two values can be replaced by the macro min_t(). This improves readability, since its quicker to understand min_t(type, x, y) than x < y ? x : y. Issue found by coccicheck. Signed-off-by: Emily Peri <eperi1024@gmail.com> Link: https://lore.kernel.org/r/Y1wh1zYMAbbKSrGB@marshmallow Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtl8723bs/os_dep')
-rw-r--r--drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
index 6aeb169c6ebf..54004f846cf0 100644
--- a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
+++ b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
@@ -1551,7 +1551,7 @@ static int rtw_cfg80211_set_wpa_ie(struct adapter *padapter, u8 *pie, size_t iel
wps_ie = rtw_get_wps_ie(buf, ielen, NULL, &wps_ielen);
if (wps_ie && wps_ielen > 0) {
- padapter->securitypriv.wps_ie_len = wps_ielen < MAX_WPS_IE_LEN ? wps_ielen : MAX_WPS_IE_LEN;
+ padapter->securitypriv.wps_ie_len = min_t(uint, wps_ielen, MAX_WPS_IE_LEN);
memcpy(padapter->securitypriv.wps_ie, wps_ie, padapter->securitypriv.wps_ie_len);
set_fwstate(&padapter->mlmepriv, WIFI_UNDER_WPS);
} else {