* [PATCH] staging: r8188eu: use min() instead of ternary operator
@ 2022-10-30 8:10 Michael Straube
2022-10-30 10:40 ` Philipp Hortmann
0 siblings, 1 reply; 2+ messages in thread
From: Michael Straube @ 2022-10-30 8:10 UTC (permalink / raw)
To: gregkh; +Cc: Larry.Finger, phil, linux-staging, linux-kernel, Michael Straube
Replace a ternary operator usage with the min() macro to improve
readability.
Signed-off-by: Michael Straube <straube.linux@gmail.com>
---
drivers/staging/r8188eu/os_dep/ioctl_linux.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/r8188eu/os_dep/ioctl_linux.c b/drivers/staging/r8188eu/os_dep/ioctl_linux.c
index 8516e253bb03..22aab3f986b4 100644
--- a/drivers/staging/r8188eu/os_dep/ioctl_linux.c
+++ b/drivers/staging/r8188eu/os_dep/ioctl_linux.c
@@ -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);
--
2.38.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] staging: r8188eu: use min() instead of ternary operator
2022-10-30 8:10 [PATCH] staging: r8188eu: use min() instead of ternary operator Michael Straube
@ 2022-10-30 10:40 ` Philipp Hortmann
0 siblings, 0 replies; 2+ messages in thread
From: Philipp Hortmann @ 2022-10-30 10:40 UTC (permalink / raw)
To: Michael Straube, gregkh; +Cc: Larry.Finger, phil, linux-staging, linux-kernel
On 10/30/22 09:10, Michael Straube wrote:
> Replace a ternary operator usage with the min() macro to improve
> readability.
>
> Signed-off-by: Michael Straube <straube.linux@gmail.com>
> ---
> drivers/staging/r8188eu/os_dep/ioctl_linux.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/r8188eu/os_dep/ioctl_linux.c b/drivers/staging/r8188eu/os_dep/ioctl_linux.c
> index 8516e253bb03..22aab3f986b4 100644
> --- a/drivers/staging/r8188eu/os_dep/ioctl_linux.c
> +++ b/drivers/staging/r8188eu/os_dep/ioctl_linux.c
> @@ -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);
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-10-30 10:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-30 8:10 [PATCH] staging: r8188eu: use min() instead of ternary operator Michael Straube
2022-10-30 10:40 ` Philipp Hortmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox