net: dsa: mv88e6xxx: Constify struct devlink_region_ops and struct mv88e6xxx_region
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sun, 29 Jun 2025 12:35:49 +0000 (14:35 +0200)
committerJakub Kicinski <kuba@kernel.org>
Wed, 2 Jul 2025 02:31:38 +0000 (19:31 -0700)
commitff2d4cfdaf91891b22117414133736f3e3d2f481
treea11bce7d441f642797ba26d94640168ab0f20942
parentfad9cf216597a71936ac87143d1618fbbcf97cbe
net: dsa: mv88e6xxx: Constify struct devlink_region_ops and struct mv88e6xxx_region

'struct devlink_region_ops' and 'struct mv88e6xxx_region' 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, as an example:
Before:
======
   text    data     bss     dec     hex filename
  18076    6496      64   24636    603c drivers/net/dsa/mv88e6xxx/devlink.o

After:
=====
   text    data     bss     dec     hex filename
  18652    5920      64   24636    603c drivers/net/dsa/mv88e6xxx/devlink.o

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://patch.msgid.link/46040062161dda211580002f950a6d60433243dc.1751200453.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/dsa/mv88e6xxx/devlink.c