lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2026012728-dreadful-sliver-07e9@gregkh>
Date: Tue, 27 Jan 2026 15:37:12 +0100
From: Greg KH <gregkh@...uxfoundation.org>
To: William Hansen-Baird <william.hansen.baird@...il.com>
Cc: linux-staging@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 4/5] staging: rtl8723bs: replace ternary comparison with
 min_t()

On Fri, Jan 16, 2026 at 11:08:50AM -0500, William Hansen-Baird wrote:
> Replace ternary comparison for setting copy_len with the min_t() function
> from linux/minmax.h.
> Change is purely cosmetic, however makes the line easier to read without having to reason
> about logic.
> 
> Signed-off-by: William Hansen-Baird <william.hansen.baird@...il.com>
> ---
>  drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
> index 8e41eb61448f..842e95e1eaec 100644
> --- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
> +++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
> @@ -4,6 +4,7 @@
>   * Copyright(c) 2007 - 2012 Realtek Corporation. All rights reserved.
>   *
>   ******************************************************************************/
> +#include <linux/minmax.h>
>  #include <drv_types.h>
>  #include <rtw_wifi_regd.h>
>  #include <hal_btcoex.h>
> @@ -1024,13 +1025,11 @@ static unsigned short rtw_parse_assoc_security_ies(struct adapter *padapter,
>  			pstat->flags |= WLAN_STA_WPS;
>  			copy_len = 0;
>  		} else {
> -			copy_len = ((wpa_ie_len+2) > sizeof(pstat->wpa_ie)) ? (sizeof(pstat->wpa_ie)):(wpa_ie_len+2);
> +			copy_len = min_t(int, sizeof(pstat->wpa_ie), wpa_ie_len+2);

Why is the type needed here?

And your new line has a coding style problem, always run your patches
through checkpatch.pl please.



>  		}
>  
> -
>  		if (copy_len > 0)
>  			memcpy(pstat->wpa_ie, wpa_ie-2, copy_len);
> -

These lines are not mentioned in the changelog :(

Remember, only do 1 thing per patch.

thanks,

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ