Skip to contentSkip to conversation

ASoC: Staticise and constify cs42l73_reg_defaults

PATCH In review Mark Brown 2 participants 4 messages Nov 22, 2011 – Nov 28, 2011

Subsystems (3)
lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH 1/1 ASoC: Staticise and constify cs42l73_reg_defaults

It's not exported and doesn't need to change.

---
 sound/soc/codecs/cs42l73.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
sound/soc/codecs/cs42l73.c +1 -1
index 5544f14..2b294a9 100644
@@ -42,7 +42,7 @@ struct  cs42l73_private {
 	u32 mclk;
 };
 
-struct reg_default cs42l73_reg_defaults[] = {
+static const struct reg_default cs42l73_reg_defaults[] = {
 	{ 1, 0x42 },	/* r01	- Device ID A&B */
 	{ 2, 0xA7 },	/* r02	- Device ID C&D */
 	{ 3, 0x30 },	/* r03	- Device ID E */
Signature · 1 line
1.7.7.3
#1 lore raw
Quoted 5 lines
sound/soc/codecs/cs42l73.c +1 -1
-struct reg_default cs42l73_reg_defaults[] = {
+static const struct reg_default cs42l73_reg_defaults[] = {
	{ 1, 0x42 },	/* r01	- Device ID A&B */
	{ 2, 0xA7 },	/* r02	- Device ID C&D */
	{ 3, 0x30 },	/* r03	- Device ID E */

Shouldn't this require struct reg_default *reg_defaults; be const as well?

sound/soc/codecs/cs42l73.c:1327: warning: initialization discards qualifiers from pointer target type

Or not use const?

-Brian

author
#2 lore raw
Quoted 5 lines · Brian Austin

Shouldn't this require struct reg_default *reg_defaults; be const as well?

sound/soc/codecs/cs42l73.c:1327: warning: initialization discards qualifiers from pointer target type

It'll all be fine in -next, the regmap header has changed there.

#3 lore raw
Quoted 4 lines

It'll all be fine in -next, the regmap header has changed there.

OK
Thanks