Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: intel: Constify struct snd_soc_ops

Constifying "struct snd_soc_ops" moves some data to a read-only section, so
increase overall security.

This structure is also part of scripts/const_structs.checkpatch.

As an example, on a x86_64, with allmodconfig:
Before:
text data bss dec hex filename
6315 3696 0 10011 271b sound/soc/intel/boards/ehl_rt5660.o

After:
text data bss dec hex filename
6379 3648 0 10027 272b sound/soc/intel/boards/ehl_rt5660.o

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://msgid.link/r/2f0613bf4c6018569cdaac876d0589e49cf38a80.1715622793.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Christophe JAILLET and committed by
Mark Brown
ed258130 5dfd8f78

+22 -22
+1 -1
sound/soc/intel/boards/bdw-rt5650.c
··· 131 131 return ret; 132 132 } 133 133 134 - static struct snd_soc_ops bdw_rt5650_ops = { 134 + static const struct snd_soc_ops bdw_rt5650_ops = { 135 135 .hw_params = bdw_rt5650_hw_params, 136 136 }; 137 137
+1 -1
sound/soc/intel/boards/ehl_rt5660.c
··· 132 132 return ret; 133 133 } 134 134 135 - static struct snd_soc_ops rt5660_ops = { 135 + static const struct snd_soc_ops rt5660_ops = { 136 136 .hw_params = rt5660_hw_params, 137 137 }; 138 138
+2 -2
sound/soc/intel/boards/kbl_da7219_max98357a.c
··· 354 354 SNDRV_PCM_HW_PARAM_RATE, &constraints_rates); 355 355 } 356 356 357 - static struct snd_soc_ops kabylake_dmic_ops = { 357 + static const struct snd_soc_ops kabylake_dmic_ops = { 358 358 .startup = kabylake_dmic_startup, 359 359 }; 360 360 ··· 388 388 &constraints_16000); 389 389 } 390 390 391 - static struct snd_soc_ops skylake_refcap_ops = { 391 + static const struct snd_soc_ops skylake_refcap_ops = { 392 392 .startup = kabylake_refcap_startup, 393 393 }; 394 394
+3 -3
sound/soc/intel/boards/kbl_da7219_max98927.c
··· 288 288 return 0; 289 289 } 290 290 291 - static struct snd_soc_ops kabylake_ssp0_ops = { 291 + static const struct snd_soc_ops kabylake_ssp0_ops = { 292 292 .hw_params = kabylake_ssp0_hw_params, 293 293 .trigger = kabylake_ssp0_trigger, 294 294 }; ··· 535 535 SNDRV_PCM_HW_PARAM_RATE, &constraints_rates); 536 536 } 537 537 538 - static struct snd_soc_ops kabylake_dmic_ops = { 538 + static const struct snd_soc_ops kabylake_dmic_ops = { 539 539 .startup = kabylake_dmic_startup, 540 540 }; 541 541 ··· 569 569 } 570 570 571 571 572 - static struct snd_soc_ops skylake_refcap_ops = { 572 + static const struct snd_soc_ops skylake_refcap_ops = { 573 573 .startup = kabylake_refcap_startup, 574 574 }; 575 575
+1 -1
sound/soc/intel/boards/kbl_rt5660.c
··· 277 277 return ret; 278 278 } 279 279 280 - static struct snd_soc_ops kabylake_rt5660_ops = { 280 + static const struct snd_soc_ops kabylake_rt5660_ops = { 281 281 .hw_params = kabylake_rt5660_hw_params, 282 282 }; 283 283
+4 -4
sound/soc/intel/boards/kbl_rt5663_max98927.c
··· 489 489 return ret; 490 490 } 491 491 492 - static struct snd_soc_ops kabylake_rt5663_ops = { 492 + static const struct snd_soc_ops kabylake_rt5663_ops = { 493 493 .hw_params = kabylake_rt5663_hw_params, 494 494 }; 495 495 ··· 539 539 return ret; 540 540 } 541 541 542 - static struct snd_soc_ops kabylake_ssp0_ops = { 542 + static const struct snd_soc_ops kabylake_ssp0_ops = { 543 543 .hw_params = kabylake_ssp0_hw_params, 544 544 }; 545 545 ··· 575 575 SNDRV_PCM_HW_PARAM_RATE, &constraints_rates); 576 576 } 577 577 578 - static struct snd_soc_ops kabylake_dmic_ops = { 578 + static const struct snd_soc_ops kabylake_dmic_ops = { 579 579 .startup = kabylake_dmic_startup, 580 580 }; 581 581 ··· 609 609 &constraints_16000); 610 610 } 611 611 612 - static struct snd_soc_ops skylake_refcap_ops = { 612 + static const struct snd_soc_ops skylake_refcap_ops = { 613 613 .startup = kabylake_refcap_startup, 614 614 }; 615 615
+3 -3
sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c
··· 424 424 return ret; 425 425 } 426 426 427 - static struct snd_soc_ops kabylake_rt5663_ops = { 427 + static const struct snd_soc_ops kabylake_rt5663_ops = { 428 428 .hw_params = kabylake_rt5663_hw_params, 429 429 }; 430 430 ··· 469 469 return ret; 470 470 } 471 471 472 - static struct snd_soc_ops kabylake_ssp0_ops = { 472 + static const struct snd_soc_ops kabylake_ssp0_ops = { 473 473 .hw_params = kabylake_ssp0_hw_params, 474 474 }; 475 475 ··· 508 508 SNDRV_PCM_HW_PARAM_RATE, &constraints_rates); 509 509 } 510 510 511 - static struct snd_soc_ops kabylake_dmic_ops = { 511 + static const struct snd_soc_ops kabylake_dmic_ops = { 512 512 .startup = kabylake_dmic_startup, 513 513 }; 514 514
+1 -1
sound/soc/intel/boards/sof_es8336.c
··· 371 371 } 372 372 373 373 /* machine stream operations */ 374 - static struct snd_soc_ops sof_es8336_ops = { 374 + static const struct snd_soc_ops sof_es8336_ops = { 375 375 .hw_params = sof_es8336_hw_params, 376 376 .trigger = sof_8336_trigger, 377 377 };
+1 -1
sound/soc/intel/boards/sof_nau8825.c
··· 115 115 return ret; 116 116 } 117 117 118 - static struct snd_soc_ops sof_nau8825_ops = { 118 + static const struct snd_soc_ops sof_nau8825_ops = { 119 119 .hw_params = sof_nau8825_hw_params, 120 120 }; 121 121
+1 -1
sound/soc/intel/boards/sof_realtek_common.c
··· 452 452 return ret; 453 453 } 454 454 455 - static struct snd_soc_ops rt1015_ops = { 455 + static const struct snd_soc_ops rt1015_ops = { 456 456 .hw_params = rt1015_hw_params, 457 457 }; 458 458
+1 -1
sound/soc/intel/boards/sof_rt5682.c
··· 397 397 return ret; 398 398 } 399 399 400 - static struct snd_soc_ops sof_rt5682_ops = { 400 + static const struct snd_soc_ops sof_rt5682_ops = { 401 401 .hw_params = sof_rt5682_hw_params, 402 402 }; 403 403
+1 -1
sound/soc/intel/boards/sof_sdw_common.h
··· 169 169 int sof_sdw_rt_sdca_jack_exit(struct snd_soc_card *card, struct snd_soc_dai_link *dai_link); 170 170 171 171 /* RT1308 I2S support */ 172 - extern struct snd_soc_ops sof_sdw_rt1308_i2s_ops; 172 + extern const struct snd_soc_ops sof_sdw_rt1308_i2s_ops; 173 173 174 174 /* generic amp support */ 175 175 int sof_sdw_rt_amp_init(struct snd_soc_card *card,
+1 -1
sound/soc/intel/boards/sof_sdw_rt_amp.c
··· 233 233 } 234 234 235 235 /* machine stream operations */ 236 - struct snd_soc_ops sof_sdw_rt1308_i2s_ops = { 236 + const struct snd_soc_ops sof_sdw_rt1308_i2s_ops = { 237 237 .hw_params = rt1308_i2s_hw_params, 238 238 }; 239 239
+1 -1
sound/soc/intel/boards/sof_wm8804.c
··· 148 148 } 149 149 150 150 /* machine stream operations */ 151 - static struct snd_soc_ops sof_wm8804_ops = { 151 + static const struct snd_soc_ops sof_wm8804_ops = { 152 152 .hw_params = sof_wm8804_hw_params, 153 153 }; 154 154