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

ALSA: replace CONFIG_PROC_FS with CONFIG_SND_PROC_FS

We may disable proc fs only for sound part, to reduce ALSA
memory footprint. So add CONFIG_SND_PROC_FS and replace the
old CONFIG_PROC_FSs in alsa code.

With sound proc fs disabled, we can save about 9KB memory
size on X86_64 platform.

Signed-off-by: Jie Yang <yang.jie@intel.com>
Reviewed-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

authored by

Jie Yang and committed by
Takashi Iwai
cd6a6503 e0ecb05a

+52 -52
+4 -4
include/sound/info.h
··· 92 92 struct list_head list; 93 93 }; 94 94 95 - #if defined(CONFIG_SND_OSSEMUL) && defined(CONFIG_PROC_FS) 95 + #if defined(CONFIG_SND_OSSEMUL) && defined(CONFIG_SND_PROC_FS) 96 96 int snd_info_minor_register(void); 97 97 #else 98 98 #define snd_info_minor_register() 0 99 99 #endif 100 100 101 101 102 - #ifdef CONFIG_PROC_FS 102 + #ifdef CONFIG_SND_PROC_FS 103 103 104 104 extern struct snd_info_entry *snd_seq_root; 105 105 #ifdef CONFIG_SND_OSSEMUL ··· 197 197 * OSS info part 198 198 */ 199 199 200 - #if defined(CONFIG_SND_OSSEMUL) && defined(CONFIG_PROC_FS) 200 + #if defined(CONFIG_SND_OSSEMUL) && defined(CONFIG_SND_PROC_FS) 201 201 202 202 #define SNDRV_OSS_INFO_DEV_AUDIO 0 203 203 #define SNDRV_OSS_INFO_DEV_SYNTH 1 ··· 210 210 int snd_oss_info_register(int dev, int num, char *string); 211 211 #define snd_oss_info_unregister(dev, num) snd_oss_info_register(dev, num, NULL) 212 212 213 - #endif /* CONFIG_SND_OSSEMUL && CONFIG_PROC_FS */ 213 + #endif /* CONFIG_SND_OSSEMUL && CONFIG_SND_PROC_FS */ 214 214 215 215 #endif /* __SOUND_INFO_H */
+1 -1
sound/core/Makefile
··· 4 4 # 5 5 6 6 snd-y := sound.o init.o memory.o control.o misc.o device.o 7 - ifneq ($(CONFIG_PROC_FS),) 7 + ifneq ($(CONFIG_SND_PROC_FS),) 8 8 snd-y += info.o 9 9 snd-$(CONFIG_SND_OSSEMUL) += info_oss.o 10 10 endif
+3 -3
sound/core/hwdep.c
··· 484 484 return 0; 485 485 } 486 486 487 - #ifdef CONFIG_PROC_FS 487 + #ifdef CONFIG_SND_PROC_FS 488 488 /* 489 489 * Info interface 490 490 */ ··· 521 521 { 522 522 snd_info_free_entry(snd_hwdep_proc_entry); 523 523 } 524 - #else /* !CONFIG_PROC_FS */ 524 + #else /* !CONFIG_SND_PROC_FS */ 525 525 #define snd_hwdep_proc_init() 526 526 #define snd_hwdep_proc_done() 527 - #endif /* CONFIG_PROC_FS */ 527 + #endif /* CONFIG_SND_PROC_FS */ 528 528 529 529 530 530 /*
+4 -4
sound/core/init.c
··· 100 100 EXPORT_SYMBOL(snd_mixer_oss_notify_callback); 101 101 #endif 102 102 103 - #ifdef CONFIG_PROC_FS 103 + #ifdef CONFIG_SND_PROC_FS 104 104 static void snd_card_id_read(struct snd_info_entry *entry, 105 105 struct snd_info_buffer *buffer) 106 106 { ··· 122 122 123 123 return snd_info_card_register(card); 124 124 } 125 - #else /* !CONFIG_PROC_FS */ 125 + #else /* !CONFIG_SND_PROC_FS */ 126 126 #define init_info_for_card(card) 127 127 #endif 128 128 ··· 776 776 777 777 EXPORT_SYMBOL(snd_card_register); 778 778 779 - #ifdef CONFIG_PROC_FS 779 + #ifdef CONFIG_SND_PROC_FS 780 780 static void snd_card_info_read(struct snd_info_entry *entry, 781 781 struct snd_info_buffer *buffer) 782 782 { ··· 861 861 862 862 return 0; 863 863 } 864 - #endif /* CONFIG_PROC_FS */ 864 + #endif /* CONFIG_SND_PROC_FS */ 865 865 866 866 /** 867 867 * snd_component_add - add a component string
+3 -3
sound/core/oss/mixer_oss.c
··· 1111 1111 return 0; 1112 1112 } 1113 1113 1114 - #ifdef CONFIG_PROC_FS 1114 + #ifdef CONFIG_SND_PROC_FS 1115 1115 /* 1116 1116 */ 1117 1117 #define MIXER_VOL(name) [SOUND_MIXER_##name] = #name ··· 1255 1255 snd_info_free_entry(mixer->proc_entry); 1256 1256 mixer->proc_entry = NULL; 1257 1257 } 1258 - #else /* !CONFIG_PROC_FS */ 1258 + #else /* !CONFIG_SND_PROC_FS */ 1259 1259 #define snd_mixer_oss_proc_init(mix) 1260 1260 #define snd_mixer_oss_proc_done(mix) 1261 - #endif /* CONFIG_PROC_FS */ 1261 + #endif /* CONFIG_SND_PROC_FS */ 1262 1262 1263 1263 static void snd_mixer_oss_build(struct snd_mixer_oss *mixer) 1264 1264 {
+3 -3
sound/core/pcm.c
··· 1181 1181 } 1182 1182 EXPORT_SYMBOL(snd_pcm_notify); 1183 1183 1184 - #ifdef CONFIG_PROC_FS 1184 + #ifdef CONFIG_SND_PROC_FS 1185 1185 /* 1186 1186 * Info interface 1187 1187 */ ··· 1227 1227 snd_info_free_entry(snd_pcm_proc_entry); 1228 1228 } 1229 1229 1230 - #else /* !CONFIG_PROC_FS */ 1230 + #else /* !CONFIG_SND_PROC_FS */ 1231 1231 #define snd_pcm_proc_init() 1232 1232 #define snd_pcm_proc_done() 1233 - #endif /* CONFIG_PROC_FS */ 1233 + #endif /* CONFIG_SND_PROC_FS */ 1234 1234 1235 1235 1236 1236 /*
+3 -3
sound/core/seq/oss/seq_oss.c
··· 45 45 */ 46 46 static int register_device(void); 47 47 static void unregister_device(void); 48 - #ifdef CONFIG_PROC_FS 48 + #ifdef CONFIG_SND_PROC_FS 49 49 static int register_proc(void); 50 50 static void unregister_proc(void); 51 51 #else ··· 261 261 * /proc interface 262 262 */ 263 263 264 - #ifdef CONFIG_PROC_FS 264 + #ifdef CONFIG_SND_PROC_FS 265 265 266 266 static struct snd_info_entry *info_entry; 267 267 ··· 303 303 snd_info_free_entry(info_entry); 304 304 info_entry = NULL; 305 305 } 306 - #endif /* CONFIG_PROC_FS */ 306 + #endif /* CONFIG_SND_PROC_FS */
+2 -3
sound/core/seq/oss/seq_oss_init.c
··· 479 479 snd_seq_oss_timer_stop(dp->timer); 480 480 } 481 481 482 - 483 - #ifdef CONFIG_PROC_FS 482 + #ifdef CONFIG_SND_PROC_FS 484 483 /* 485 484 * misc. functions for proc interface 486 485 */ ··· 530 531 snd_seq_oss_readq_info_read(dp->readq, buf); 531 532 } 532 533 } 533 - #endif /* CONFIG_PROC_FS */ 534 + #endif /* CONFIG_SND_PROC_FS */
+2 -2
sound/core/seq/oss/seq_oss_midi.c
··· 665 665 } 666 666 667 667 668 - #ifdef CONFIG_PROC_FS 668 + #ifdef CONFIG_SND_PROC_FS 669 669 /* 670 670 * proc interface 671 671 */ ··· 705 705 snd_use_lock_free(&mdev->use_lock); 706 706 } 707 707 } 708 - #endif /* CONFIG_PROC_FS */ 708 + #endif /* CONFIG_SND_PROC_FS */
+2 -2
sound/core/seq/oss/seq_oss_readq.c
··· 222 222 } 223 223 224 224 225 - #ifdef CONFIG_PROC_FS 225 + #ifdef CONFIG_SND_PROC_FS 226 226 /* 227 227 * proc interface 228 228 */ ··· 233 233 (waitqueue_active(&q->midi_sleep) ? "sleeping":"running"), 234 234 q->qlen, q->input_time); 235 235 } 236 - #endif /* CONFIG_PROC_FS */ 236 + #endif /* CONFIG_SND_PROC_FS */
+2 -2
sound/core/seq/oss/seq_oss_synth.c
··· 630 630 } 631 631 632 632 633 - #ifdef CONFIG_PROC_FS 633 + #ifdef CONFIG_SND_PROC_FS 634 634 /* 635 635 * proc interface 636 636 */ ··· 658 658 snd_use_lock_free(&rec->use_lock); 659 659 } 660 660 } 661 - #endif /* CONFIG_PROC_FS */ 661 + #endif /* CONFIG_SND_PROC_FS */
+2 -2
sound/core/seq/seq_clientmgr.c
··· 2447 2447 2448 2448 /*---------------------------------------------------------------------------*/ 2449 2449 2450 - #ifdef CONFIG_PROC_FS 2450 + #ifdef CONFIG_SND_PROC_FS 2451 2451 /* 2452 2452 * /proc interface 2453 2453 */ ··· 2549 2549 snd_seq_client_unlock(client); 2550 2550 } 2551 2551 } 2552 - #endif /* CONFIG_PROC_FS */ 2552 + #endif /* CONFIG_SND_PROC_FS */ 2553 2553 2554 2554 /*---------------------------------------------------------------------------*/ 2555 2555
+1 -1
sound/core/seq/seq_device.c
··· 72 72 /* 73 73 * proc interface -- just for compatibility 74 74 */ 75 - #ifdef CONFIG_PROC_FS 75 + #ifdef CONFIG_SND_PROC_FS 76 76 static struct snd_info_entry *info_entry; 77 77 78 78 static int print_dev_info(struct device *dev, void *data)
+1 -1
sound/core/seq/seq_info.h
··· 29 29 void snd_seq_info_queues_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer); 30 30 31 31 32 - #ifdef CONFIG_PROC_FS 32 + #ifdef CONFIG_SND_PROC_FS 33 33 int snd_seq_info_init( void ); 34 34 int snd_seq_info_done( void ); 35 35 #else
+2 -2
sound/core/seq/seq_queue.c
··· 753 753 754 754 /*----------------------------------------------------------------*/ 755 755 756 - #ifdef CONFIG_PROC_FS 756 + #ifdef CONFIG_SND_PROC_FS 757 757 /* exported to seq_info.c */ 758 758 void snd_seq_info_queues_read(struct snd_info_entry *entry, 759 759 struct snd_info_buffer *buffer) ··· 787 787 queuefree(q); 788 788 } 789 789 } 790 - #endif /* CONFIG_PROC_FS */ 790 + #endif /* CONFIG_SND_PROC_FS */ 791 791
+2 -2
sound/core/seq/seq_timer.c
··· 422 422 } 423 423 424 424 425 - #ifdef CONFIG_PROC_FS 425 + #ifdef CONFIG_SND_PROC_FS 426 426 /* exported to seq_info.c */ 427 427 void snd_seq_info_timer_read(struct snd_info_entry *entry, 428 428 struct snd_info_buffer *buffer) ··· 449 449 queuefree(q); 450 450 } 451 451 } 452 - #endif /* CONFIG_PROC_FS */ 452 + #endif /* CONFIG_SND_PROC_FS */ 453 453
+2 -2
sound/core/sound.c
··· 330 330 } 331 331 EXPORT_SYMBOL(snd_unregister_device); 332 332 333 - #ifdef CONFIG_PROC_FS 333 + #ifdef CONFIG_SND_PROC_FS 334 334 /* 335 335 * INFO PART 336 336 */ ··· 391 391 entry->c.text.read = snd_minor_info_read; 392 392 return snd_info_register(entry); /* freed in error path */ 393 393 } 394 - #endif /* CONFIG_PROC_FS */ 394 + #endif /* CONFIG_SND_PROC_FS */ 395 395 396 396 /* 397 397 * INIT PART
+2 -2
sound/core/sound_oss.c
··· 207 207 * INFO PART 208 208 */ 209 209 210 - #ifdef CONFIG_PROC_FS 210 + #ifdef CONFIG_SND_PROC_FS 211 211 static const char *snd_oss_device_type_name(int type) 212 212 { 213 213 switch (type) { ··· 259 259 entry->c.text.read = snd_minor_info_oss_read; 260 260 return snd_info_register(entry); /* freed in error path */ 261 261 } 262 - #endif /* CONFIG_PROC_FS */ 262 + #endif /* CONFIG_SND_PROC_FS */
+2 -2
sound/core/timer.c
··· 1034 1034 return snd_timer_global_register(timer); 1035 1035 } 1036 1036 1037 - #ifdef CONFIG_PROC_FS 1037 + #ifdef CONFIG_SND_PROC_FS 1038 1038 /* 1039 1039 * Info interface 1040 1040 */ ··· 1104 1104 { 1105 1105 snd_info_free_entry(snd_timer_proc_entry); 1106 1106 } 1107 - #else /* !CONFIG_PROC_FS */ 1107 + #else /* !CONFIG_SND_PROC_FS */ 1108 1108 #define snd_timer_proc_init() 1109 1109 #define snd_timer_proc_done() 1110 1110 #endif
+2 -1
sound/pci/hda/Makefile
··· 3 3 4 4 snd-hda-codec-y := hda_bind.o hda_codec.o hda_jack.o hda_auto_parser.o hda_sysfs.o 5 5 snd-hda-codec-y += hda_controller.o 6 - snd-hda-codec-$(CONFIG_PROC_FS) += hda_proc.o 6 + snd-hda-codec-$(CONFIG_SND_PROC_FS) += hda_proc.o 7 + 7 8 snd-hda-codec-$(CONFIG_SND_HDA_HWDEP) += hda_hwdep.o 8 9 snd-hda-codec-$(CONFIG_SND_HDA_INPUT_BEEP) += hda_beep.o 9 10
+2 -2
sound/pci/hda/hda_eld.c
··· 448 448 hdmi_show_short_audio_desc(codec, e->sad + i); 449 449 } 450 450 451 - #ifdef CONFIG_PROC_FS 451 + #ifdef CONFIG_SND_PROC_FS 452 452 453 453 static void hdmi_print_sad_info(int i, struct cea_sad *a, 454 454 struct snd_info_buffer *buffer) ··· 586 586 } 587 587 } 588 588 } 589 - #endif /* CONFIG_PROC_FS */ 589 + #endif /* CONFIG_SND_PROC_FS */ 590 590 591 591 /* update PCM info based on ELD */ 592 592 void snd_hdmi_eld_update_pcm_info(struct parsed_hdmi_eld *e,
+2 -2
sound/pci/hda/hda_local.h
··· 330 330 /* 331 331 * generic proc interface 332 332 */ 333 - #ifdef CONFIG_PROC_FS 333 + #ifdef CONFIG_SND_PROC_FS 334 334 int snd_hda_codec_proc_new(struct hda_codec *codec); 335 335 #else 336 336 static inline int snd_hda_codec_proc_new(struct hda_codec *codec) { return 0; } ··· 777 777 unsigned char *buf, int *eld_size, 778 778 bool rev3_or_later); 779 779 780 - #ifdef CONFIG_PROC_FS 780 + #ifdef CONFIG_SND_PROC_FS 781 781 void snd_hdmi_print_eld_info(struct hdmi_eld *eld, 782 782 struct snd_info_buffer *buffer); 783 783 void snd_hdmi_write_eld_info(struct hdmi_eld *eld,
+2 -2
sound/pci/hda/patch_hdmi.c
··· 86 86 bool non_pcm; 87 87 bool chmap_set; /* channel-map override by ALSA API? */ 88 88 unsigned char chmap[8]; /* ALSA API channel-map */ 89 - #ifdef CONFIG_PROC_FS 89 + #ifdef CONFIG_SND_PROC_FS 90 90 struct snd_info_entry *proc_entry; 91 91 #endif 92 92 }; ··· 548 548 * ELD proc files 549 549 */ 550 550 551 - #ifdef CONFIG_PROC_FS 551 + #ifdef CONFIG_SND_PROC_FS 552 552 static void print_eld_info(struct snd_info_entry *entry, 553 553 struct snd_info_buffer *buffer) 554 554 {
+1 -1
sound/pci/hda/patch_sigmatel.c
··· 4337 4337 4338 4338 #define stac_free snd_hda_gen_free 4339 4339 4340 - #ifdef CONFIG_PROC_FS 4340 + #ifdef CONFIG_SND_PROC_FS 4341 4341 static void stac92hd_proc_hook(struct snd_info_buffer *buffer, 4342 4342 struct hda_codec *codec, hda_nid_t nid) 4343 4343 {