[alsa-devel] [PATCH 0/4] 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(-)
Constify the ACPI device ID array and the register map, no need to have them writable at runtime.
Signed-off-by: Mathias Krause minipli@googlemail.com --- sound/soc/codecs/max98090.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/soc/codecs/max98090.c b/sound/soc/codecs/max98090.c index 3e33ef2acf3c..2b7f1097bee8 100644 --- a/sound/soc/codecs/max98090.c +++ b/sound/soc/codecs/max98090.c @@ -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 }, { } };
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_LEN define.
Signed-off-by: Mathias Krause minipli@googlemail.com Cc: Bard Liao <bardliao@realtek.com Cc: Oder Chiou oder_chiou@realtek.com --- sound/soc/codecs/rt5640.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/sound/soc/codecs/rt5640.c b/sound/soc/codecs/rt5640.c index 178e55d4d481..914681978222 100644 --- a/sound/soc/codecs/rt5640.c +++ b/sound/soc/codecs/rt5640.c @@ -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 },
On Sat, Jun 13, 2015 at 02:25:14PM +0200, Mathias Krause wrote:
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_LEN define.
Signed-off-by: Mathias Krause minipli@googlemail.com Cc: Bard Liao <bardliao@realtek.com Cc: Oder Chiou oder_chiou@realtek.com
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).
On 15 June 2015 at 12:19, Mark Brown broonie@kernel.org wrote:
On Sat, Jun 13, 2015 at 02:25:14PM +0200, Mathias Krause wrote:
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_LEN define.
Signed-off-by: Mathias Krause minipli@googlemail.com Cc: Bard Liao <bardliao@realtek.com Cc: Oder Chiou oder_chiou@realtek.com
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
Constify 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.
Signed-off-by: Mathias Krause minipli@googlemail.com Cc: Oder Chiou oder_chiou@realtek.com Cc: Bard Liao <bardliao@realtek.com --- sound/soc/codecs/rt5670.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/sound/soc/codecs/rt5670.c b/sound/soc/codecs/rt5670.c index cc7f84a150a7..f87a6dabbd49 100644 --- a/sound/soc/codecs/rt5670.c +++ b/sound/soc/codecs/rt5670.c @@ -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}, { }, };
Constify the ACPI device ID array, it doesn't need to be writable at runtime.
Signed-off-by: Mathias Krause minipli@googlemail.com Cc: Jarkko Nikula jarkko.nikula@linux.intel.com --- sound/soc/intel/common/sst-acpi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/intel/common/sst-acpi.c b/sound/soc/intel/common/sst-acpi.c index 42f293f9c6e2..67b6d3d52f57 100644 --- a/sound/soc/intel/common/sst-acpi.c +++ b/sound/soc/intel/common/sst-acpi.c @@ -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 },
On 06/13/2015 03:25 PM, Mathias Krause wrote:
Constify the ACPI device ID array, it doesn't need to be writable at runtime.
Signed-off-by: Mathias Krause minipli@googlemail.com Cc: Jarkko Nikula jarkko.nikula@linux.intel.com
sound/soc/intel/common/sst-acpi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Acked-by: Jarkko Nikula jarkko.nikula@linux.intel.com
On Sat, Jun 13, 2015 at 02:25:12PM +0200, Mathias Krause wrote:
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.
Applied, but again please make an effort to use relevant CC lists for patches.
On 15 June 2015 at 12:32, Mark Brown broonie@kernel.org wrote:
On Sat, Jun 13, 2015 at 02:25:12PM +0200, Mathias Krause wrote:
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.
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
On Mon, Jun 15, 2015 at 07:59:30PM +0200, Mathias Krause wrote:
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).
participants (3)
-
Jarkko Nikula
-
Mark Brown
-
Mathias Krause