Thread (4 messages) 4 messages, 3 authors, 2025-01-15

Re: [PATCH net-next] net: phy: Constify struct mdio_device_id

From: Christophe JAILLET <hidden>
Date: 2025-01-12 17:03:50
Also in: kernel-janitors, linux-amlogic, linux-arm-kernel, linux-arm-msm, linux-mediatek, linux-rockchip, lkml

Le 12/01/2025 à 17:46, Andrew Lunn a écrit :
On Sun, Jan 12, 2025 at 03:14:50PM +0100, Christophe JAILLET wrote:
quoted
'struct mdio_device_id' is not modified in these drivers.

Constifying these structures moves some data to a read-only section, so
increase overall security.

On a x86_64, with allmodconfig, as an example:
Before:
======
    text	   data	    bss	    dec	    hex	filename
   27014	  12792	      0	  39806	   9b7e	drivers/net/phy/broadcom.o

After:
=====
    text	   data	    bss	    dec	    hex	filename
   27206	  12600	      0	  39806	   9b7e	drivers/net/phy/broadcom.o

Signed-off-by: Christophe JAILLET <redacted>
Seems sensible.

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

Is the long terms goal to make MODULE_DEVICE_TABLE() enforce the
const?
It was not my initial goal, but I can give it a look if you think it's 
worth it.

But some other constifications will be needed before that.

CJ
     Andrew
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help