Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net: phy: mscc: make some arrays static const, makes object smaller

Don't populate arrays on the stack but instead them static const.
Makes the object code smaller by 280 bytes.

Before:
text data bss dec hex filename
24142 4368 192 28702 701e ./drivers/net/phy/mscc/mscc_ptp.o

After:
text data bss dec hex filename
23830 4400 192 28422 6f06 ./drivers/net/phy/mscc/mscc_ptp.o

(gcc version 10.2.0)

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20210801070155.139057-1-colin.king@canonical.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Colin Ian King and committed by
Jakub Kicinski
1187c8c4 f36c82ac

+4 -4
+4 -4
drivers/net/phy/mscc/mscc_ptp.c
··· 506 506 { 507 507 struct vsc8531_private *vsc8531 = phydev->priv; 508 508 bool base = phydev->mdio.addr == vsc8531->ts_base_addr; 509 - u8 msgs[] = { 509 + static const u8 msgs[] = { 510 510 PTP_MSGTYPE_SYNC, 511 511 PTP_MSGTYPE_DELAY_REQ 512 512 }; ··· 847 847 static int vsc85xx_ptp_conf(struct phy_device *phydev, enum ts_blk blk, 848 848 bool one_step, bool enable) 849 849 { 850 - u8 msgs[] = { 850 + static const u8 msgs[] = { 851 851 PTP_MSGTYPE_SYNC, 852 852 PTP_MSGTYPE_DELAY_REQ 853 853 }; ··· 1268 1268 static int __vsc8584_init_ptp(struct phy_device *phydev) 1269 1269 { 1270 1270 struct vsc8531_private *vsc8531 = phydev->priv; 1271 - u32 ltc_seq_e[] = { 0, 400000, 0, 0, 0 }; 1272 - u8 ltc_seq_a[] = { 8, 6, 5, 4, 2 }; 1271 + static const u32 ltc_seq_e[] = { 0, 400000, 0, 0, 0 }; 1272 + static const u8 ltc_seq_a[] = { 8, 6, 5, 4, 2 }; 1273 1273 u32 val; 1274 1274 1275 1275 if (!vsc8584_is_1588_input_clk_configured(phydev)) {