Skip to content

Commit

Permalink
staging: rtl8723bs: Replace ternary statement with min function
Browse files Browse the repository at this point in the history
Ternary statements that pick the min of two values can be replaced by
the built-in min() function. This improves readability, since its quicker
to understand min(x, y) than x < y ? x : y. Issue found by coccicheck.

Signed-off-by: Emily Peri <eperi1024@gmail.com>
  • Loading branch information
Emily Peri authored and intel-lab-lkp committed Oct 27, 2022
1 parent 8cd7565 commit c222133
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
Expand Up @@ -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(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 {
Expand Down

0 comments on commit c222133

Please sign in to comment.