ASoC: constification patches
Subsystems (4)
cover ASoC: constification patches
Hi Liam, Mark,
this series constifies a few variables in the SoC code that are only read, namely struct reg_default and struct acpi_device_id.
Please apply!
Mathias Krause (4):
ASoC: max98090: Constify ACPI device ids and register map
ASoC: rt5640: Constify ACPI device ids and register map
ASoC: rt5670: Constify ACPI device ids and register map
ASoC: intel: Constify ACPI device ids
sound/soc/codecs/max98090.c | 4 ++-- sound/soc/codecs/rt5640.c | 5 ++--- sound/soc/codecs/rt5670.c | 5 ++--- sound/soc/intel/common/sst-acpi.c | 2 +- 4 files changed, 7 insertions(+), 9 deletions(-)
Signature · 1 line
1.7.10.4
PATCH 1/4 ASoC: max98090: Constify ACPI device ids and register map
Constify the ACPI device ID array and the register map, no need to have them writable at runtime.
--- sound/soc/codecs/max98090.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/codecs/max98090.c +2 -2
@@ -27,7 +27,7 @@#include "max98090.h" /* Allows for sparsely populated register maps */ -static struct reg_default max98090_reg[] = { +static const struct reg_default max98090_reg[] = { {0x00 ,0x00 },/* 00 Software Reset */ {0x03 ,0x04 },/* 03 Interrupt Masks */ {0x04 ,0x00 },/* 04 System Clock Quick */
@@ -2696,7 +2696,7 @@ static const struct of_device_id max98090_of_match[] = {MODULE_DEVICE_TABLE (of, max98090_of_match);#ifdef CONFIG_ACPI -static struct acpi_device_id max98090_acpi_match[] = { +static const struct acpi_device_id max98090_acpi_match[] = { {"193C9890" ,MAX98090 }, { } };
Signature · 1 line
1.7.10.4
PATCH 2/4 ASoC: rt5640: Constify ACPI device ids and register map
In reply to Mathias KrauseConstify the ACPI device ID array and the register map, no need to have them writable at runtime. Also drop the unneeded RT5640_INIT_REG_LEN define.
--- sound/soc/codecs/rt5640.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
sound/soc/codecs/rt5640.c +2 -3
@@ -51,7 +51,7 @@ static const struct regmap_range_cfg rt5640_ranges[] = { .window_len = 0x1, }, }; -static struct reg_default init_list[] = { +static const struct reg_default init_list[] = { {RT5640_PR_BASE +0x3d ,0x3600 }, {RT5640_PR_BASE +0x12 ,0x0aa8 }, {RT5640_PR_BASE + 0x14, 0x0aaa},
@@ -59,7 +59,6 @@ static struct reg_default init_list[] = { {RT5640_PR_BASE + 0x21, 0xe0e0}, {RT5640_PR_BASE + 0x23, 0x1804}, }; -#define RT5640_INIT_REG_LEN ARRAY_SIZE(init_list)static const struct reg_default rt5640_reg[] = { { 0x00, 0x000e },
@@ -2122,7 +2121,7 @@ MODULE_DEVICE_TABLE(of, rt5640_of_match);#endif #ifdef CONFIG_ACPI -static struct acpi_device_id rt5640_acpi_match[] = { +static const struct acpi_device_id rt5640_acpi_match[] = { {"INT33CA" ,0 }, {"10EC5640" ,0 }, { "10EC5642", 0 },
Signature · 1 line
1.7.10.4
Mark Brown
maintainerRe: [PATCH 2/4] ASoC: rt5640: Constify ACPI device ids and register map
Quoted 7 lines · Mathias Krause
Constify the ACPI device ID array and the register map, no need to have them writable at runtime. Also drop the unneeded
RT5640_INIT_REG_LENdefine.Signed-off-by Mathias Krause <[email protected]>Cc Bard Liao <[email protected]Cc Oder Chiou <[email protected]>
Please don't include stuff like this in the commit log if you're not using it - you've CCed Oder but not Bard here (you should be CCing him).
Re: [PATCH 2/4] ASoC: rt5640: Constify ACPI device ids and register map
Quoted 11 lines · Mark Brown
Quoted 7 lines · Mathias Krause
Constify the ACPI device ID array and the register map, no need to have them writable at runtime. Also drop the unneeded
RT5640_INIT_REG_LENdefine.Signed-off-by Mathias Krause <[email protected]>Cc Bard Liao <[email protected]Cc Oder Chiou <[email protected]>Please don't include stuff like this in the commit log if you're not using it - you've CCed Oder but not Bard here (you should be CCing him).
Sorry, I messed it up! I relied in 'git send-email' to add the required Cc's but due to the missing closing bracket Bard was skipped. Sorry. Will take more care next time!
Thanks,
Mathias
PATCH 3/4 ASoC: rt5670: Constify ACPI device ids and register map
In reply to Mathias KrauseConstify the ACPI device ID array and the register map, no need to have them writable at runtime. Also drop the unneeded RT5670_INIT_REG_LEN define.
--- sound/soc/codecs/rt5670.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
sound/soc/codecs/rt5670.c +2 -3
@@ -51,12 +51,11 @@ static const struct regmap_range_cfg rt5670_ranges[] = { .window_len = 0x1, }, }; -static struct reg_default init_list[] = { +static const struct reg_default init_list[] = { {RT5670_PR_BASE +0x14 ,0x9a8a }, {RT5670_PR_BASE +0x38 ,0x3ba1 }, {RT5670_PR_BASE +0x3d ,0x3640 }, }; -#define RT5670_INIT_REG_LEN ARRAY_SIZE(init_list)static const struct reg_default rt5670_reg[] = { { 0x00, 0x0000 },
@@ -2809,7 +2808,7 @@ static const struct i2c_device_id rt5670_i2c_id[] = {MODULE_DEVICE_TABLE (i2c, rt5670_i2c_id);#ifdef CONFIG_ACPI -static struct acpi_device_id rt5670_acpi_match[] = { +static const struct acpi_device_id rt5670_acpi_match[] = { {"10EC5670" ,0 }, { }, };
Signature · 1 line
1.7.10.4
PATCH 4/4 ASoC: intel: Constify ACPI device ids
In reply to Mathias KrauseConstify the ACPI device ID array, it doesn't need to be writable at runtime.
--- sound/soc/intel/common/sst-acpi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/intel/common/sst-acpi.c +1 -1
@@ -263,7 +263,7 @@ static struct sst_acpi_desc sst_acpi_baytrail_desc = { .resindex_dma_base = -1, }; -static struct acpi_device_id sst_acpi_match[] = { +static const struct acpi_device_id sst_acpi_match[] = { {"INT33C8" , (unsigned long )&sst_acpi_haswell_desc }, {"INT3438" , (unsigned long )&sst_acpi_broadwell_desc }, {"80860F28" , (unsigned long )&sst_acpi_baytrail_desc },
Signature · 1 line
1.7.10.4
Re: [PATCH 4/4] ASoC: intel: Constify ACPI device ids
Quoted 9 lines · Mathias Krause
Constify the ACPI device ID array, it doesn't need to be writable at runtime.
Signed-off-by Mathias Krause <[email protected]>Cc Jarkko Nikula <[email protected]>--- sound/soc/intel/common/sst-acpi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 4 lines · Mathias Krause
Hi Liam, Mark,
this series constifies a few variables in the SoC code that are only read, namely struct
reg_defaultand structacpi_device_id.
Applied, but again please make an effort to use relevant CC lists for patches.
Quoted 8 lines · Mark Brown
Quoted 4 lines · Mathias Krause
Hi Liam, Mark,
this series constifies a few variables in the SoC code that are only read, namely struct
reg_defaultand structacpi_device_id.Applied, but again please make an effort to use relevant CC lists for patches.
Sorry, actually I tried to. It's what get_maintainer.pl told me but I tried to trim down the list because of the simpleness of the patches. I omitted LKML to avoid cross-posting. I messed up patches 2 and 3, admitted. But what else was wrong?
Regards,
Mathias
Mark Brown
maintainerQuoted 4 lines · Mathias Krause
Sorry, actually I tried to. It's what get_maintainer.pl told me but I tried to trim down the list because of the simpleness of the patches. I omitted LKML to avoid cross-posting. I messed up patches 2 and 3, admitted. But what else was wrong?
I can't remember now, perhaps it was just the second Realtek patch. Like I say you shouldn't treat get_maintainer.pl as reliable (it can be a good start but without --git it often misses people and with --git it gets way too many false positives).