Re: [PATCH] powercap: dtpm: Constify some structures
From: Abel Vesa
Date: Mon Nov 02 2026 - 08:34:17 EST
On 26-11-01 10:15:06, Christophe JAILLET wrote:
> 'struct powercap_zone_constraint_ops', 'struct powercap_zone_ops' and the
> 'dtpm_node_callback_t' array 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.
>
> On a x86_64, with allmodconfig:
> Before:
> ======
> text data bss dec hex filename
> 22049 7736 128 29913 74d9 drivers/powercap/dtpm.o
>
> After:
> =====
> text data bss dec hex filename
> 22273 7512 128 29913 74d9 drivers/powercap/dtpm.o
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@xxxxxxxxxx>
Seems straightforward enough for me, so:
Reviewed-by: Abel Vesa <abel.vesa@xxxxxxxxxxxxxxxx>