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] [day] [month] [year] [list]
Message-ID: <10539bd8-5ce3-4f18-96f9-c87e537467f3@roeck-us.net>
Date: Tue, 27 Aug 2024 08:07:15 -0700
From: Guenter Roeck <linux@...ck-us.net>
To: Shen Lichuan <shenlichuan@...o.com>
Cc: jim.cromie@...il.com, jdelvare@...e.com, linux-hwmon@...r.kernel.org,
	linux-kernel@...r.kernel.org, opensource.kernel@...o.com
Subject: Re: [PATCH v1] hwmon: (pc87360) Use min() macro

On Tue, Aug 27, 2024 at 03:04:42PM +0800, Shen Lichuan wrote:
> Use the min() macro to simplify the pc87360_init_device() function 
> and improve its readability.
> 
> Signed-off-by: Shen Lichuan <shenlichuan@...o.com>

Applied.

Thanks,
Guenter

> ---
>  drivers/hwmon/pc87360.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/hwmon/pc87360.c b/drivers/hwmon/pc87360.c
> index 9e9681b2e8c5..788b5d58f77e 100644
> --- a/drivers/hwmon/pc87360.c
> +++ b/drivers/hwmon/pc87360.c
> @@ -1315,7 +1315,7 @@ static void pc87360_init_device(struct platform_device *pdev,
>  				    (reg & 0xC0) | 0x11);
>  	}
>  
> -	nr = data->innr < 11 ? data->innr : 11;
> +	nr = min(data->innr, 11);
>  	for (i = 0; i < nr; i++) {
>  		reg = pc87360_read_value(data, LD_IN, i,
>  					 PC87365_REG_IN_STATUS);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ