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

phy: ti: j721e-wiz: Constify structs

clk_div_table and wiz_regmap_config are not modified and can therefore
be made const to allow the compiler to put them in read-only memory.

Before:
text data bss dec hex filename
20265 7044 64 27373 6aed drivers/phy/ti/phy-j721e-wiz.o

After:
text data bss dec hex filename
20649 6660 64 27373 6aed drivers/phy/ti/phy-j721e-wiz.o

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Link: https://lore.kernel.org/r/20200524095516.25227-3-rikard.falkeborn@gmail.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Rikard Falkeborn and committed by
Vinod Koul
5a72122d 0cb5ebc7

+5 -5
+5 -5
drivers/phy/ti/phy-j721e-wiz.c
··· 117 117 struct wiz_clk_divider { 118 118 struct clk_hw hw; 119 119 struct regmap_field *field; 120 - struct clk_div_table *table; 120 + const struct clk_div_table *table; 121 121 struct clk_init_data clk_data; 122 122 }; 123 123 ··· 131 131 132 132 struct wiz_clk_div_sel { 133 133 struct regmap_field *field; 134 - struct clk_div_table *table; 134 + const struct clk_div_table *table; 135 135 const char *node_name; 136 136 }; 137 137 ··· 173 173 }, 174 174 }; 175 175 176 - static struct clk_div_table clk_div_table[] = { 176 + static const struct clk_div_table clk_div_table[] = { 177 177 { .val = 0, .div = 1, }, 178 178 { .val = 1, .div = 2, }, 179 179 { .val = 2, .div = 4, }, ··· 559 559 560 560 static int wiz_div_clk_register(struct wiz *wiz, struct device_node *node, 561 561 struct regmap_field *field, 562 - struct clk_div_table *table) 562 + const struct clk_div_table *table) 563 563 { 564 564 struct device *dev = wiz->dev; 565 565 struct wiz_clk_divider *div; ··· 756 756 .deassert = wiz_phy_reset_deassert, 757 757 }; 758 758 759 - static struct regmap_config wiz_regmap_config = { 759 + static const struct regmap_config wiz_regmap_config = { 760 760 .reg_bits = 32, 761 761 .val_bits = 32, 762 762 .reg_stride = 4,