Browse Source

ALSA: sb: Constify hw_constraints

snd_pcm_hw_constraint_list(), *_ratnums() and *_ratdens() receive the
const pointers.  Constify the corresponding static objects for better
hardening.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai 8 years ago
parent
commit
b078bbfbb1
1 changed files with 3 additions and 3 deletions
  1. 3 3
      sound/isa/sb/sb8_main.c

+ 3 - 3
sound/isa/sb/sb8_main.c

@@ -46,19 +46,19 @@ MODULE_LICENSE("GPL");
 #define SB8_DEN(v)	((SB8_CLOCK + (v) / 2) / (v))
 #define SB8_DEN(v)	((SB8_CLOCK + (v) / 2) / (v))
 #define SB8_RATE(v)	(SB8_CLOCK / SB8_DEN(v))
 #define SB8_RATE(v)	(SB8_CLOCK / SB8_DEN(v))
 
 
-static struct snd_ratnum clock = {
+static const struct snd_ratnum clock = {
 	.num = SB8_CLOCK,
 	.num = SB8_CLOCK,
 	.den_min = 1,
 	.den_min = 1,
 	.den_max = 256,
 	.den_max = 256,
 	.den_step = 1,
 	.den_step = 1,
 };
 };
 
 
-static struct snd_pcm_hw_constraint_ratnums hw_constraints_clock = {
+static const struct snd_pcm_hw_constraint_ratnums hw_constraints_clock = {
 	.nrats = 1,
 	.nrats = 1,
 	.rats = &clock,
 	.rats = &clock,
 };
 };
 
 
-static struct snd_ratnum stereo_clocks[] = {
+static const struct snd_ratnum stereo_clocks[] = {
 	{
 	{
 		.num = SB8_CLOCK,
 		.num = SB8_CLOCK,
 		.den_min = SB8_DEN(22050),
 		.den_min = SB8_DEN(22050),