diff mbox

ALSA: pcm: add const qualifier for read-only table for sampling rate

Message ID 20170516234820.14728-1-o-takashi@sakamocchi.jp (mailing list archive)
State New, archived
Headers show

Commit Message

Takashi Sakamoto May 16, 2017, 11:48 p.m. UTC
There's a read-only table for each sampling rate, while it doesn't have
const qualifier and can be modified.

This commit add the qualifier. As a result, a symbol for the table
moves from .data section to .rodata.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
---
 sound/core/pcm_native.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Takashi Iwai May 17, 2017, 5:44 a.m. UTC | #1
On Wed, 17 May 2017 01:48:17 +0200,
Takashi Sakamoto wrote:
> 
> There's a read-only table for each sampling rate, while it doesn't have
> const qualifier and can be modified.
> 
> This commit add the qualifier. As a result, a symbol for the table
> moves from .data section to .rodata.
> 
> Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>

Thanks, applied all four patches now.


Takashi
diff mbox

Patch

diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
index d873f90..f3a3580 100644
--- a/sound/core/pcm_native.c
+++ b/sound/core/pcm_native.c
@@ -1987,8 +1987,10 @@  static int snd_pcm_hw_rule_sample_bits(struct snd_pcm_hw_params *params,
 #error "Change this table"
 #endif
 
-static unsigned int rates[] = { 5512, 8000, 11025, 16000, 22050, 32000, 44100,
-                                 48000, 64000, 88200, 96000, 176400, 192000 };
+static const unsigned int rates[] = {
+	5512, 8000, 11025, 16000, 22050, 32000, 44100,
+	48000, 64000, 88200, 96000, 176400, 192000
+};
 
 const struct snd_pcm_hw_constraint_list snd_pcm_known_rates = {
 	.count = ARRAY_SIZE(rates),