Message ID | 20200701200950.30314-2-rikard.falkeborn@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | drivers/char: Constify static variables | expand |
On 7/1/2020 1:09 PM, Rikard Falkeborn wrote: > bcm2835_rng_devtype[] is not modified and can be made const to allow the > compiler to put it in read-only memory. > > Before: > text data bss dec hex filename > 2392 176 0 2568 a08 drivers/char/hw_random/bcm2835-rng.o > > After: > text data bss dec hex filename > 2464 104 0 2568 a08 drivers/char/hw_random/bcm2835-rng.o > > Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com> Acked-by: Florian Fainelli <f.fainelli@gmail.com>
diff --git a/drivers/char/hw_random/bcm2835-rng.c b/drivers/char/hw_random/bcm2835-rng.c index cbf5eaea662c..0839236a6d19 100644 --- a/drivers/char/hw_random/bcm2835-rng.c +++ b/drivers/char/hw_random/bcm2835-rng.c @@ -188,7 +188,7 @@ static int bcm2835_rng_probe(struct platform_device *pdev) MODULE_DEVICE_TABLE(of, bcm2835_rng_of_match); -static struct platform_device_id bcm2835_rng_devtype[] = { +static const struct platform_device_id bcm2835_rng_devtype[] = { { .name = "bcm2835-rng" }, { .name = "bcm63xx-rng" }, { /* sentinel */ }
bcm2835_rng_devtype[] is not modified and can be made const to allow the compiler to put it in read-only memory. Before: text data bss dec hex filename 2392 176 0 2568 a08 drivers/char/hw_random/bcm2835-rng.o After: text data bss dec hex filename 2464 104 0 2568 a08 drivers/char/hw_random/bcm2835-rng.o Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com> --- drivers/char/hw_random/bcm2835-rng.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)