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

ALSA: seq: More constifications

Apply const prefix to the remaining sequencer code: the static tables
for MIDI macros, RPN/NRPN, and some strings.

Just for minor optimization and no functional changes.

Link: https://lore.kernel.org/r/20200105144823.29547-7-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>

+8 -8
+2 -2
sound/core/seq/oss/seq_oss_init.c
··· 460 460 return bool ? "enabled" : "disabled"; 461 461 } 462 462 463 - static char * 463 + static const char * 464 464 filemode_str(int val) 465 465 { 466 - static char *str[] = { 466 + static const char * const str[] = { 467 467 "none", "read", "write", "read/write", 468 468 }; 469 469 return str[val & SNDRV_SEQ_OSS_FILE_ACMODE];
+3 -3
sound/core/seq/seq_midi_emul.c
··· 479 479 struct snd_midi_channel_set *chset) 480 480 { 481 481 /* GM on */ 482 - static unsigned char gm_on_macro[] = { 482 + static const unsigned char gm_on_macro[] = { 483 483 0x7e,0x7f,0x09,0x01, 484 484 }; 485 485 /* XG on */ 486 - static unsigned char xg_on_macro[] = { 486 + static const unsigned char xg_on_macro[] = { 487 487 0x43,0x10,0x4c,0x00,0x00,0x7e,0x00, 488 488 }; 489 489 /* GS prefix ··· 492 492 * chorus mode: XX=0x01, YY=0x38, ZZ=0-7 493 493 * master vol: XX=0x00, YY=0x04, ZZ=0-127 494 494 */ 495 - static unsigned char gs_pfx_macro[] = { 495 + static const unsigned char gs_pfx_macro[] = { 496 496 0x41,0x10,0x42,0x12,0x40,/*XX,YY,ZZ*/ 497 497 }; 498 498
+3 -3
sound/core/seq/seq_midi_event.c
··· 422 422 int count, struct snd_seq_event *ev) 423 423 { 424 424 unsigned char cmd; 425 - char *cbytes; 426 - static char cbytes_nrpn[4] = { MIDI_CTL_NONREG_PARM_NUM_MSB, 425 + const char *cbytes; 426 + static const char cbytes_nrpn[4] = { MIDI_CTL_NONREG_PARM_NUM_MSB, 427 427 MIDI_CTL_NONREG_PARM_NUM_LSB, 428 428 MIDI_CTL_MSB_DATA_ENTRY, 429 429 MIDI_CTL_LSB_DATA_ENTRY }; 430 - static char cbytes_rpn[4] = { MIDI_CTL_REGIST_PARM_NUM_MSB, 430 + static const char cbytes_rpn[4] = { MIDI_CTL_REGIST_PARM_NUM_MSB, 431 431 MIDI_CTL_REGIST_PARM_NUM_LSB, 432 432 MIDI_CTL_MSB_DATA_ENTRY, 433 433 MIDI_CTL_LSB_DATA_ENTRY };