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: <20250522143309.GA1378991@google.com>
Date: Thu, 22 May 2025 15:33:09 +0100
From: Lee Jones <lee@...nel.org>
To: Alexandru Soponar <asoponar@...adin.ro>
Cc: linux-kernel@...r.kernel.org, linux-hwmon@...r.kernel.org,
	linux-iio@...r.kernel.org, linux-leds@...r.kernel.org,
	linux-watchdog@...r.kernel.org, jdelvare@...e.com,
	linux@...ck-us.net, jic23@...nel.org, pavel@....cz,
	baocheng.su@...mens.com, wim@...ux-watchdog.org,
	tobias.schaffner@...mens.com,
	angelogioacchino.delregno@...labora.com,
	benedikt.niedermayr@...mens.com, matthias.bgg@...il.com,
	aardelean@...libre.com, contact@...y.one
Subject: Re: [PATCH 13/16] leds: eds-mt6370-rgb: Fix type incompatibility
 with find_closest()

On Thu, 15 May 2025, Alexandru Soponar wrote:

> The common_tfreqs and mt6372_tfreqs arrays were previously declared as
> unsigned int but used with find_closest(), which now takes signed int
> parameters. Change these arrays from unsigned int to int to maintain type
> compatibility with the find_closest() function signature and prevent
> compilation errors.
> 
> Signed-off-by: Alexandru Soponar <asoponar@...adin.ro>
> ---
>  drivers/leds/rgb/leds-mt6370-rgb.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)

Acked-by: Lee Jones <lee@...nel.org>

> diff --git a/drivers/leds/rgb/leds-mt6370-rgb.c b/drivers/leds/rgb/leds-mt6370-rgb.c
> index ebd3ba878dd5..6ce11432dd96 100644
> --- a/drivers/leds/rgb/leds-mt6370-rgb.c
> +++ b/drivers/leds/rgb/leds-mt6370-rgb.c
> @@ -135,7 +135,7 @@ struct mt6370_led {
>  };
>  
>  struct mt6370_pdata {
> -	const unsigned int *tfreq;
> +	const int *tfreq;
>  	unsigned int tfreq_len;
>  	u16 reg_rgb1_tr;
>  	s16 reg_rgb_chrind_tr;
> @@ -212,11 +212,11 @@ static const struct linear_range mt6372_led_ranges[R_MAX_RANGES] = {
>  	[R_LED_TOFF]	= { 250, 0, 15, 500 },
>  };
>  
> -static const unsigned int common_tfreqs[] = {
> +static const int common_tfreqs[] = {
>  	10000, 5000, 2000, 1000, 500, 200, 5, 1,
>  };
>  
> -static const unsigned int mt6372_tfreqs[] = {
> +static const int mt6372_tfreqs[] = {
>  	8000, 4000, 2000, 1000, 500, 250, 8, 4,
>  };
>  
> @@ -304,7 +304,8 @@ static int mt6370_set_led_freq(struct mt6370_priv *priv, unsigned int led_no, un
>  	const struct mt6370_pdata *pdata = priv->pdata;
>  	enum mt6370_led_field sel_field;
>  	unsigned int tfreq_len = pdata->tfreq_len;
> -	unsigned int tsum, sel;
> +	unsigned int sel;
> +	int tsum;
>  
>  	tsum = ton + toff;
>  
> -- 
> 2.49.0
> 

-- 
Lee Jones [李琼斯]

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ