Skip to contentSkip to conversation

staging: r8188eu: use min() instead of ternary operator

PATCH In review Michael Straube 2 participants 2 messages Oct 30, 2022 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: r8188eu: use min() instead of ternary operator

Replace a ternary operator usage with the min() macro to improve readability.

---
 drivers/staging/r8188eu/os_dep/ioctl_linux.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/r8188eu/os_dep/ioctl_linux.c +1 -1
index 8516e253bb03..22aab3f986b4 100644
@@ -3568,7 +3568,7 @@ static int rtw_wx_set_priv(struct net_device *dev,
 
 		if ((_VENDOR_SPECIFIC_IE_ == probereq_wpsie[0]) &&
 		    (!memcmp(&probereq_wpsie[2], wps_oui, 4))) {
-			cp_sz = probereq_wpsie_len > MAX_WPS_IE_LEN ? MAX_WPS_IE_LEN : probereq_wpsie_len;
+			cp_sz = min(probereq_wpsie_len, MAX_WPS_IE_LEN);
 
 			pmlmepriv->wps_probe_req_ie_len = 0;
 			kfree(pmlmepriv->wps_probe_req_ie);
Signature · 1 line
2.38.0
Tested-by on v1 1/1
#1 lore raw
Quoted 13 lines · Michael Straube

Replace a ternary operator usage with the min() macro to improve readability.

---
  drivers/staging/r8188eu/os_dep/ioctl_linux.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/r8188eu/os_dep/ioctl_linux.c +0 -0
index 8516e253bb03..22aab3f986b4 100644

drivers/staging/r8188eu/os_dep/ioctl_linux.c static int rtw_wx_set_priv(struct net_device *dev, · line 3574

Quoted 8 lines
drivers/staging/r8188eu/os_dep/ioctl_linux.c +1 -1
@@ -3568,7 +3568,7 @@ static int rtw_wx_set_priv(struct net_device *dev,
 
  		if ((_VENDOR_SPECIFIC_IE_ == probereq_wpsie[0]) &&
  		    (!memcmp(&probereq_wpsie[2], wps_oui, 4))) {
-			cp_sz = probereq_wpsie_len > MAX_WPS_IE_LEN ? MAX_WPS_IE_LEN : probereq_wpsie_len;
+			cp_sz = min(probereq_wpsie_len, MAX_WPS_IE_LEN);
 
  			pmlmepriv->wps_probe_req_ie_len = 0;
  			kfree(pmlmepriv->wps_probe_req_ie);