Re: [PATCH net-next] mlxsw: core_thermal: Constify struct thermal_zone_device_ops
From: Ido Schimmel
Date: Sun May 25 2025 - 13:26:25 EST
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 <christophe.jaillet@xxxxxxxxxx>
Reviewed-by: Ido Schimmel <idosch@xxxxxxxxxx>