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

phy: qcom-qmp: make a const array static, makes object smaller

Don't populate the const array cfg1_settings on the stack but instead make
it static. Makes the object code smaller by 24 bytes:

Before:
text data bss dec hex filename
73585 20240 64 93889 16ec1 drivers/phy/qualcomm/phy-qcom-qmp.o

After:
text data bss dec hex filename
73465 20336 64 93865 16ea9 drivers/phy/qualcomm/phy-qcom-qmp.o

(gcc version 10.2.0)

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20210204180313.108876-1-colin.king@canonical.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Colin Ian King and committed by
Vinod Koul
43851904 3dbbc8e9

+1 -1
+1 -1
drivers/phy/qualcomm/phy-qcom-qmp.c
··· 3545 3545 static int qcom_qmp_dp_phy_calibrate(struct phy *phy) 3546 3546 { 3547 3547 struct qmp_phy *qphy = phy_get_drvdata(phy); 3548 - const u8 cfg1_settings[] = { 0x13, 0x23, 0x1d }; 3548 + static const u8 cfg1_settings[] = { 0x13, 0x23, 0x1d }; 3549 3549 u8 val; 3550 3550 3551 3551 qphy->dp_aux_cfg++;