[<prev] [next>] [day] [month] [year] [list]
Message-ID: <d5e686f47eddb14245d0fde693ff77ae749f7a08.1731689646.git.christophe.jaillet@wanadoo.fr>
Date: Fri, 15 Nov 2024 17:54:25 +0100
From: Christophe JAILLET <christophe.jaillet@...adoo.fr>
To: David Rhodes <david.rhodes@...rus.com>,
Richard Fitzgerald <rf@...nsource.cirrus.com>,
Liam Girdwood <lgirdwood@...il.com>,
Mark Brown <broonie@...nel.org>,
Jaroslav Kysela <perex@...ex.cz>,
Takashi Iwai <tiwai@...e.com>
Cc: linux-kernel@...r.kernel.org,
kernel-janitors@...r.kernel.org,
Christophe JAILLET <christophe.jaillet@...adoo.fr>,
linux-sound@...r.kernel.org,
patches@...nsource.cirrus.com
Subject: [PATCH] ASoC: cs42l51: Constify struct i2c_device_id
'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@...adoo.fr>
---
Compile tested-only.
---
sound/soc/codecs/cs42l51-i2c.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/sound/soc/codecs/cs42l51-i2c.c b/sound/soc/codecs/cs42l51-i2c.c
index e7cc50096297..f171bd66fcac 100644
--- a/sound/soc/codecs/cs42l51-i2c.c
+++ b/sound/soc/codecs/cs42l51-i2c.c
@@ -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);
--
2.47.0
Powered by blists - more mailing lists