]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ASoC: cs42l51: Constify struct i2c_device_id
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Fri, 15 Nov 2024 16:54:25 +0000 (17:54 +0100)
committerMark Brown <broonie@kernel.org>
Mon, 2 Dec 2024 00:30:40 +0000 (00:30 +0000)
'struct i2c_device_id' is not modified in this driver.

Constifying this structure moves some data to a read-only section, so
increase overall security.

While at it, also add some space to be consistent with cs42l51_of_match a
few lines below.

On a x86_64, with allmodconfig:
Before:
======
   text    data     bss     dec     hex filename
   1551     384      16    1951     79f sound/soc/codecs/cs42l51-i2c.o

After:
=====
   text    data     bss     dec     hex filename
   1631     304      16    1951     79f sound/soc/codecs/cs42l51-i2c.o

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://patch.msgid.link/d5e686f47eddb14245d0fde693ff77ae749f7a08.1731689646.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/cs42l51-i2c.c

index e7cc5009629782d160d295bc8f4837d8e06bbbcb..f171bd66fcac3ece67fc8f11af6dea608071fa02 100644 (file)
@@ -13,9 +13,9 @@
 
 #include "cs42l51.h"
 
-static struct i2c_device_id cs42l51_i2c_id[] = {
-       {"cs42l51"},
-       {}
+static const struct i2c_device_id cs42l51_i2c_id[] = {
+       { "cs42l51" },
+       { }
 };
 MODULE_DEVICE_TABLE(i2c, cs42l51_i2c_id);