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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <rq710p19-nq43-p91r-56o4-p75468q5psp4@onlyvoer.pbz>
Date: Tue, 22 Oct 2024 16:08:13 -0400 (EDT)
From: Nicolas Pitre <npitre@...libre.com>
To: Colin Ian King <colin.i.king@...il.com>
cc: "Rafael J . Wysocki" <rafael@...nel.org>, 
    Daniel Lezcano <daniel.lezcano@...aro.org>, 
    Zhang Rui <rui.zhang@...el.com>, Lukasz Luba <lukasz.luba@....com>, 
    Matthias Brugger <matthias.bgg@...il.com>, 
    AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>, 
    linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org, 
    linux-arm-kernel@...ts.infradead.org, kernel-janitors@...r.kernel.org, 
    linux-mediatek@...ts.infradead.org
Subject: Re: [PATCH][next] thermal/drivers/mediatek/lvts_thermal: make
 read-only arrays static const

On Tue, 22 Oct 2024, Colin Ian King wrote:

> Don't populate the read-only arrays on the stack at run time, instead
> make them static const.
> 
> Signed-off-by: Colin Ian King <colin.i.king@...il.com>

Reviewed-by: Nicolas Pitre <npitre@...libre.com>

> ---
>  drivers/thermal/mediatek/lvts_thermal.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/thermal/mediatek/lvts_thermal.c b/drivers/thermal/mediatek/lvts_thermal.c
> index 1997e91bb3be..ce223bab6b55 100644
> --- a/drivers/thermal/mediatek/lvts_thermal.c
> +++ b/drivers/thermal/mediatek/lvts_thermal.c
> @@ -329,7 +329,7 @@ static int lvts_get_temp(struct thermal_zone_device *tz, int *temp)
>  
>  static void lvts_update_irq_mask(struct lvts_ctrl *lvts_ctrl)
>  {
> -	u32 masks[] = {
> +	static const u32 masks[] = {
>  		LVTS_MONINT_OFFSET_SENSOR0,
>  		LVTS_MONINT_OFFSET_SENSOR1,
>  		LVTS_MONINT_OFFSET_SENSOR2,
> @@ -424,7 +424,7 @@ static irqreturn_t lvts_ctrl_irq_handler(struct lvts_ctrl *lvts_ctrl)
>  {
>  	irqreturn_t iret = IRQ_NONE;
>  	u32 value;
> -	u32 masks[] = {
> +	static const u32 masks[] = {
>  		LVTS_INT_SENSOR0,
>  		LVTS_INT_SENSOR1,
>  		LVTS_INT_SENSOR2,
> -- 
> 2.39.5
> 
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ