Skip to content

Commit 29f33f0

Browse files
tititiou36vinodkoul
authored andcommitted
phy: cadence: Sierra: Constify struct cdns_reg_pairs
'struct cdns_reg_pairs' is not modified in this driver. Constifying this structure moves some data to a read-only section, so increase overall security. On a x86_64, with allmodconfig: Before: ====== text data bss dec hex filename 60489 4342 16 64847 fd4f drivers/phy/cadence/phy-cadence-sierra.o After: ===== text data bss dec hex filename 60521 4310 16 64847 fd4f drivers/phy/cadence/phy-cadence-sierra.o Signed-off-by: Christophe JAILLET <[email protected]> Link: https://lore.kernel.org/r/c57ee8206ebba8c222d7d954335654384072b9ac.1720723132.git.christophe.jaillet@wanadoo.fr Signed-off-by: Vinod Koul <[email protected]>
1 parent ceb6e04 commit 29f33f0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/phy/cadence/phy-cadence-sierra.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1544,7 +1544,7 @@ static void cdns_sierra_phy_remove(struct platform_device *pdev)
15441544
}
15451545

15461546
/* SGMII PHY PMA lane configuration */
1547-
static struct cdns_reg_pairs sgmii_phy_pma_ln_regs[] = {
1547+
static const struct cdns_reg_pairs sgmii_phy_pma_ln_regs[] = {
15481548
{0x9010, SIERRA_PHY_PMA_XCVR_CTRL}
15491549
};
15501550

@@ -1609,7 +1609,7 @@ static struct cdns_sierra_vals sgmii_100_no_ssc_plllc1_opt3_ln_vals = {
16091609
};
16101610

16111611
/* QSGMII PHY PMA lane configuration */
1612-
static struct cdns_reg_pairs qsgmii_phy_pma_ln_regs[] = {
1612+
static const struct cdns_reg_pairs qsgmii_phy_pma_ln_regs[] = {
16131613
{0x9010, SIERRA_PHY_PMA_XCVR_CTRL}
16141614
};
16151615

@@ -1675,7 +1675,7 @@ static struct cdns_sierra_vals qsgmii_100_no_ssc_plllc1_ln_vals = {
16751675
};
16761676

16771677
/* PCIE PHY PCS common configuration */
1678-
static struct cdns_reg_pairs pcie_phy_pcs_cmn_regs[] = {
1678+
static const struct cdns_reg_pairs pcie_phy_pcs_cmn_regs[] = {
16791679
{0x0430, SIERRA_PHY_PIPE_CMN_CTRL1}
16801680
};
16811681

0 commit comments

Comments
 (0)