Re: [PATCH net-next] mlxsw: spectrum_acl_flex_keys: Constify struct mlxsw_afk_element_inst
From: Simon Horman
Date: Fri Oct 04 2024 - 08:29:38 EST
On Fri, Oct 04, 2024 at 07:26:05AM +0200, Christophe JAILLET wrote:
> 'struct mlxsw_afk_element_inst' are not modified in these drivers.
>
> Constifying these structures moves some data to a read-only section, so
> increases overall security.
>
> Update a few functions and struct mlxsw_afk_block accordingly.
>
> On a x86_64, with allmodconfig, as an example:
> Before:
> ======
> text data bss dec hex filename
> 4278 4032 0 8310 2076 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_flex_keys.o
>
> After:
> =====
> text data bss dec hex filename
> 7934 352 0 8286 205e drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_flex_keys.o
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@xxxxxxxxxx>
> ---
> Compile tested only
Reviewed-by: Simon Horman <horms@xxxxxxxxxx>