[PATCH] thermal: Constify struct thermal_zone_device_ops

Miquel Raynal miquel.raynal at bootlin.com
Mon May 26 00:29:16 PDT 2025


Hello,

On 25/05/2025 at 11:40:04 +02, Christophe JAILLET <christophe.jaillet at wanadoo.fr> wrote:

> 'struct thermal_zone_device_ops' are not modified in these drivers.
>
> Constifying these structures moves some data to a read-only section, so
> increases overall security, especially when the structure holds some
> function pointers.
>
> On a x86_64, with allmodconfig, as an example:
> Before:
> ======
>    text	   data	    bss	    dec	    hex	filename
>   28116	   5168	    128	  33412	   8284	drivers/thermal/armada_thermal.o
>
> After:
> =====
>    text	   data	    bss	    dec	    hex	filename
>   28244	   5040	    128	  33412	   8284	drivers/thermal/armada_thermal.o
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet at wanadoo.fr>
> ---
> Compile tested only
> ---
>  drivers/thermal/armada_thermal.c                        | 2 +-

Reviewed-by: Miquel Raynal <miquel.raynal at bootlin.com> # For Armada

Thanks,
Miquèl



More information about the linux-arm-kernel mailing list