Thread (3 messages) 3 messages, 3 authors, 2025-05-28

Re: [PATCH net-next] mlxsw: core_thermal: Constify struct thermal_zone_device_ops

From: Ido Schimmel <idosch@nvidia.com>
Date: 2025-05-25 17:26:10
Also in: kernel-janitors, lkml

On Sun, May 25, 2025 at 11:13:17AM +0200, Christophe JAILLET wrote:
'struct thermal_zone_device_ops' are not modified in this driver.

Constifying these structures moves some data to a read-only section, so
increases overall security, especially when the structure holds some
function pointers.

While at it, also constify a struct thermal_zone_params.

On a x86_64, with allmodconfig:
Before:
======
   text	   data	    bss	    dec	    hex	filename
  24899	   8036	      0	  32935	   80a7	drivers/net/ethernet/mellanox/mlxsw/core_thermal.o

After:
=====
   text	   data	    bss	    dec	    hex	filename
  25379	   7556	      0	  32935	   80a7	drivers/net/ethernet/mellanox/mlxsw/core_thermal.o

Signed-off-by: Christophe JAILLET <redacted>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help