Thread (1 message) 1 message, 1 author, 2025-05-26

Re: [PATCH] thermal: Constify struct thermal_zone_device_ops

From: Miquel Raynal <miquel.raynal@bootlin.com>
Date: 2025-05-26 07:29:24
Also in: imx, kernel-janitors, linux-mediatek, linux-pm, linux-renesas-soc, lkml

Hello,

On 25/05/2025 at 11:40:04 +02, Christophe JAILLET [off-list ref] 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 <redacted>
---
Compile tested only
---
 drivers/thermal/armada_thermal.c                        | 2 +-
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com> # For Armada

Thanks,
Miquèl
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help