* [PATCH][next] ASoC: rt715: Make read-only arrays capture_reg_H and capture_reg_L static const
@ 2022-12-02 17:14 Colin Ian King
2022-12-05 17:29 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Colin Ian King @ 2022-12-02 17:14 UTC (permalink / raw)
To: Oder Chiou, Liam Girdwood, Mark Brown, Jaroslav Kysela,
Takashi Iwai, alsa-devel
Cc: kernel-janitors, linux-kernel
Don't populate the read-only arrays capture_reg_H and capture_reg_L
on the stack but instead make them static const. Also makes the
object code a little smaller.
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
sound/soc/codecs/rt715.c | 48 ++++++++++++++++++++--------------------
1 file changed, 24 insertions(+), 24 deletions(-)
diff --git a/sound/soc/codecs/rt715.c b/sound/soc/codecs/rt715.c
index 917a04092da2..1a2036ccfbac 100644
--- a/sound/soc/codecs/rt715.c
+++ b/sound/soc/codecs/rt715.c
@@ -204,12 +204,12 @@ static int rt715_set_main_switch_put(struct snd_kcontrol *kcontrol,
struct snd_soc_dapm_context *dapm =
snd_soc_component_get_dapm(component);
struct rt715_priv *rt715 = snd_soc_component_get_drvdata(component);
- unsigned int capture_reg_H[] = {RT715_SET_GAIN_MIC_ADC_H,
- RT715_SET_GAIN_LINE_ADC_H, RT715_SET_GAIN_MIX_ADC_H,
- RT715_SET_GAIN_MIX_ADC2_H};
- unsigned int capture_reg_L[] = {RT715_SET_GAIN_MIC_ADC_L,
- RT715_SET_GAIN_LINE_ADC_L, RT715_SET_GAIN_MIX_ADC_L,
- RT715_SET_GAIN_MIX_ADC2_L};
+ static const unsigned int capture_reg_H[] = {
+ RT715_SET_GAIN_MIC_ADC_H, RT715_SET_GAIN_LINE_ADC_H,
+ RT715_SET_GAIN_MIX_ADC_H, RT715_SET_GAIN_MIX_ADC2_H };
+ static const unsigned int capture_reg_L[] = {
+ RT715_SET_GAIN_MIC_ADC_L, RT715_SET_GAIN_LINE_ADC_L,
+ RT715_SET_GAIN_MIX_ADC_L, RT715_SET_GAIN_MIX_ADC2_L };
unsigned int addr_h, addr_l, val_h = 0x0, val_ll, val_lr;
unsigned int k_shift = RT715_DIR_IN_SFT, k_changed = 0;
unsigned int read_ll, read_rl, i, j, loop_cnt = 4;
@@ -284,12 +284,12 @@ static int rt715_set_main_switch_get(struct snd_kcontrol *kcontrol,
{
struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
struct rt715_priv *rt715 = snd_soc_component_get_drvdata(component);
- unsigned int capture_reg_H[] = {RT715_SET_GAIN_MIC_ADC_H,
- RT715_SET_GAIN_LINE_ADC_H, RT715_SET_GAIN_MIX_ADC_H,
- RT715_SET_GAIN_MIX_ADC2_H};
- unsigned int capture_reg_L[] = {RT715_SET_GAIN_MIC_ADC_L,
- RT715_SET_GAIN_LINE_ADC_L, RT715_SET_GAIN_MIX_ADC_L,
- RT715_SET_GAIN_MIX_ADC2_L};
+ static const unsigned int capture_reg_H[] = {
+ RT715_SET_GAIN_MIC_ADC_H, RT715_SET_GAIN_LINE_ADC_H,
+ RT715_SET_GAIN_MIX_ADC_H, RT715_SET_GAIN_MIX_ADC2_H };
+ static const unsigned int capture_reg_L[] = {
+ RT715_SET_GAIN_MIC_ADC_L, RT715_SET_GAIN_LINE_ADC_L,
+ RT715_SET_GAIN_MIX_ADC_L, RT715_SET_GAIN_MIX_ADC2_L };
unsigned int addr_h, addr_l, val_h = 0x0, i, loop_cnt = 4;
unsigned int read_ll, read_rl;
@@ -312,12 +312,12 @@ static int rt715_set_main_vol_put(struct snd_kcontrol *kcontrol,
struct snd_soc_dapm_context *dapm =
snd_soc_component_get_dapm(component);
struct rt715_priv *rt715 = snd_soc_component_get_drvdata(component);
- unsigned int capture_reg_H[] = {RT715_SET_GAIN_MIC_ADC_H,
- RT715_SET_GAIN_LINE_ADC_H, RT715_SET_GAIN_MIX_ADC_H,
- RT715_SET_GAIN_MIX_ADC2_H};
- unsigned int capture_reg_L[] = {RT715_SET_GAIN_MIC_ADC_L,
- RT715_SET_GAIN_LINE_ADC_L, RT715_SET_GAIN_MIX_ADC_L,
- RT715_SET_GAIN_MIX_ADC2_L};
+ static const unsigned int capture_reg_H[] = {
+ RT715_SET_GAIN_MIC_ADC_H, RT715_SET_GAIN_LINE_ADC_H,
+ RT715_SET_GAIN_MIX_ADC_H, RT715_SET_GAIN_MIX_ADC2_H };
+ static const unsigned int capture_reg_L[] = {
+ RT715_SET_GAIN_MIC_ADC_L, RT715_SET_GAIN_LINE_ADC_L,
+ RT715_SET_GAIN_MIX_ADC_L, RT715_SET_GAIN_MIX_ADC2_L};
unsigned int addr_h, addr_l, val_h = 0x0, val_ll, val_lr;
unsigned int read_ll, read_rl, i, j, loop_cnt = 4, k_changed = 0;
unsigned int k_shift = RT715_DIR_IN_SFT, k_max = 0x3f;
@@ -393,12 +393,12 @@ static int rt715_set_main_vol_get(struct snd_kcontrol *kcontrol,
{
struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
struct rt715_priv *rt715 = snd_soc_component_get_drvdata(component);
- unsigned int capture_reg_H[] = {RT715_SET_GAIN_MIC_ADC_H,
- RT715_SET_GAIN_LINE_ADC_H, RT715_SET_GAIN_MIX_ADC_H,
- RT715_SET_GAIN_MIX_ADC2_H};
- unsigned int capture_reg_L[] = {RT715_SET_GAIN_MIC_ADC_L,
- RT715_SET_GAIN_LINE_ADC_L, RT715_SET_GAIN_MIX_ADC_L,
- RT715_SET_GAIN_MIX_ADC2_L};
+ static const unsigned int capture_reg_H[] = {
+ RT715_SET_GAIN_MIC_ADC_H, RT715_SET_GAIN_LINE_ADC_H,
+ RT715_SET_GAIN_MIX_ADC_H, RT715_SET_GAIN_MIX_ADC2_H };
+ static const unsigned int capture_reg_L[] = {
+ RT715_SET_GAIN_MIC_ADC_L, RT715_SET_GAIN_LINE_ADC_L,
+ RT715_SET_GAIN_MIX_ADC_L, RT715_SET_GAIN_MIX_ADC2_L };
unsigned int addr_h, addr_l, val_h = 0x0, i, loop_cnt = 4;
unsigned int read_ll, read_rl;
--
2.38.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH][next] ASoC: rt715: Make read-only arrays capture_reg_H and capture_reg_L static const
2022-12-02 17:14 [PATCH][next] ASoC: rt715: Make read-only arrays capture_reg_H and capture_reg_L static const Colin Ian King
@ 2022-12-05 17:29 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2022-12-05 17:29 UTC (permalink / raw)
To: Liam Girdwood, Takashi Iwai, Colin Ian King, Jaroslav Kysela,
alsa-devel, Oder Chiou
Cc: kernel-janitors, linux-kernel
On Fri, 2 Dec 2022 17:14:50 +0000, Colin Ian King wrote:
> Don't populate the read-only arrays capture_reg_H and capture_reg_L
> on the stack but instead make them static const. Also makes the
> object code a little smaller.
>
>
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/1] ASoC: rt715: Make read-only arrays capture_reg_H and capture_reg_L static const
commit: b5d5051971b44c9952b62f261509cf837b9d21ba
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-12-05 17:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-02 17:14 [PATCH][next] ASoC: rt715: Make read-only arrays capture_reg_H and capture_reg_L static const Colin Ian King
2022-12-05 17:29 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).