Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1718866 > unrolled thread

[PATCH] ALSA: nm256: constify snd_ac97_res_table

Started byArvind Yadav <arvind.yadav.cs@gmail.com>
First post2017-08-24 08:30 +0200
Last post2017-08-24 09:20 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] ALSA: nm256: constify snd_ac97_res_table Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-08-24 08:30 +0200
    Re: [PATCH] ALSA: nm256: constify snd_ac97_res_table Takashi Iwai <tiwai@suse.de> - 2017-08-24 09:20 +0200

#1718866 — [PATCH] ALSA: nm256: constify snd_ac97_res_table

FromArvind Yadav <arvind.yadav.cs@gmail.com>
Date2017-08-24 08:30 +0200
Subject[PATCH] ALSA: nm256: constify snd_ac97_res_table
Message-ID<uhTOq-2Pi-7@gated-at.bofh.it>
snd_ac97_res_table are not supposed to change at runtime. All functions
working with snd_ac97_res_table provided by <sound/ac97_codec.h> work with
const snd_ac97_res_table. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
 sound/pci/nm256/nm256.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/pci/nm256/nm256.c b/sound/pci/nm256/nm256.c
index 0ef8054..b97f4ea 100644
--- a/sound/pci/nm256/nm256.c
+++ b/sound/pci/nm256/nm256.c
@@ -1271,7 +1271,7 @@ static int nm256_ac97_idx(unsigned short reg)
 }
 
 /* static resolution table */
-static struct snd_ac97_res_table nm256_res_table[] = {
+static const struct snd_ac97_res_table nm256_res_table[] = {
 	{ AC97_MASTER, 0x1f1f },
 	{ AC97_HEADPHONE, 0x1f1f },
 	{ AC97_MASTER_MONO, 0x001f },
-- 
1.9.1

[toc] | [next] | [standalone]


#1718896

FromTakashi Iwai <tiwai@suse.de>
Date2017-08-24 09:20 +0200
Message-ID<uhUAN-3lb-1@gated-at.bofh.it>
In reply to#1718866
On Thu, 24 Aug 2017 08:25:28 +0200,
Arvind Yadav wrote:
> 
> snd_ac97_res_table are not supposed to change at runtime. All functions
> working with snd_ac97_res_table provided by <sound/ac97_codec.h> work with
> const snd_ac97_res_table. So mark the non-const structs as const.
> 
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>

Applied, thanks.


Takashi

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web