Commit b01b59a4 authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Jakub Kicinski
Browse files

net: phy: Constify struct mdio_device_id



'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: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Link: https://patch.msgid.link/403c381b7d9156b67ad68ffc44b8eee70c5e86a9.1736691226.git.christophe.jaillet@wanadoo.fr


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 72116720
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1038,7 +1038,7 @@ static struct phy_driver adin_driver[] = {

module_phy_driver(adin_driver);

static struct mdio_device_id __maybe_unused adin_tbl[] = {
static const struct mdio_device_id __maybe_unused adin_tbl[] = {
	{ PHY_ID_MATCH_MODEL(PHY_ID_ADIN1200) },
	{ PHY_ID_MATCH_MODEL(PHY_ID_ADIN1300) },
	{ }
+1 −1
Original line number Diff line number Diff line
@@ -340,7 +340,7 @@ static struct phy_driver adin_driver[] = {

module_phy_driver(adin_driver);

static struct mdio_device_id __maybe_unused adin_tbl[] = {
static const struct mdio_device_id __maybe_unused adin_tbl[] = {
	{ PHY_ID_MATCH_MODEL(PHY_ID_ADIN1100) },
	{ PHY_ID_MATCH_MODEL(PHY_ID_ADIN1110) },
	{ PHY_ID_MATCH_MODEL(PHY_ID_ADIN2111) },
+1 −1
Original line number Diff line number Diff line
@@ -1075,7 +1075,7 @@ static struct phy_driver en8811h_driver[] = {

module_phy_driver(en8811h_driver);

static struct mdio_device_id __maybe_unused en8811h_tbl[] = {
static const struct mdio_device_id __maybe_unused en8811h_tbl[] = {
	{ PHY_ID_MATCH_MODEL(EN8811H_PHY_ID) },
	{ }
};
+1 −1
Original line number Diff line number Diff line
@@ -111,7 +111,7 @@ static struct phy_driver am79c_drivers[] = {

module_phy_driver(am79c_drivers);

static struct mdio_device_id __maybe_unused amd_tbl[] = {
static const struct mdio_device_id __maybe_unused amd_tbl[] = {
	{ PHY_ID_AC101L, 0xfffffff0 },
	{ PHY_ID_AM79C874, 0xfffffff0 },
	{ }
+1 −1
Original line number Diff line number Diff line
@@ -1200,7 +1200,7 @@ static struct phy_driver aqr_driver[] = {

module_phy_driver(aqr_driver);

static struct mdio_device_id __maybe_unused aqr_tbl[] = {
static const struct mdio_device_id __maybe_unused aqr_tbl[] = {
	{ PHY_ID_MATCH_MODEL(PHY_ID_AQ1202) },
	{ PHY_ID_MATCH_MODEL(PHY_ID_AQ2104) },
	{ PHY_ID_MATCH_MODEL(PHY_ID_AQR105) },
Loading