Commit 04f141a8 authored by Takashi Iwai's avatar Takashi Iwai Committed by Jaroslav Kysela
Browse files

[ALSA] Optimize for config without PROC_FS (seq and oss parts)



Modules: ALSA<-OSS emulation,ALSA sequencer,ALSA<-OSS sequencer

Optimize the code when compiled without CONFIG_PROC_FS (in seq and oss
emulation parts).

Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent e28563cc
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1053,6 +1053,7 @@ static int snd_mixer_oss_build_input(struct snd_mixer_oss *mixer, struct snd_mix
	return 0;
}

#ifdef CONFIG_PROC_FS
/*
 */
#define MIXER_VOL(name) [SOUND_MIXER_##name] = #name
@@ -1200,6 +1201,10 @@ static void snd_mixer_oss_proc_done(struct snd_mixer_oss *mixer)
		mixer->proc_entry = NULL;
	}
}
#else /* !CONFIG_PROC_FS */
#define snd_mixer_oss_proc_init(mix)
#define snd_mixer_oss_proc_done(mix)
#endif /* CONFIG_PROC_FS */

static void snd_mixer_oss_build(struct snd_mixer_oss *mixer)
{
+5 −0
Original line number Diff line number Diff line
@@ -2269,6 +2269,7 @@ static int snd_pcm_oss_mmap(struct file *file, struct vm_area_struct *area)
	return 0;
}

#ifdef CONFIG_PROC_FS
/*
 *  /proc interface
 */
@@ -2420,6 +2421,10 @@ static void snd_pcm_oss_proc_done(struct snd_pcm *pcm)
		}
	}
}
#else /* !CONFIG_PROC_FS */
#define snd_pcm_oss_proc_init(pcm)
#define snd_pcm_oss_proc_done(pcm)
#endif /* CONFIG_PROC_FS */

/*
 *  ENTRY functions
+6 −8
Original line number Diff line number Diff line
@@ -52,8 +52,13 @@ int seq_oss_debug = 0;
 */
static int register_device(void);
static void unregister_device(void);
#ifdef CONFIG_PROC_FS
static int register_proc(void);
static void unregister_proc(void);
#else
static inline int register_proc(void) { return 0; }
static inline void unregister_proc(void) {}
#endif

static int odev_open(struct inode *inode, struct file *file);
static int odev_release(struct inode *inode, struct file *file);
@@ -61,9 +66,6 @@ static ssize_t odev_read(struct file *file, char __user *buf, size_t count, loff
static ssize_t odev_write(struct file *file, const char __user *buf, size_t count, loff_t *offset);
static long odev_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
static unsigned int odev_poll(struct file *file, poll_table * wait);
#ifdef CONFIG_PROC_FS
static void info_read(struct snd_info_entry *entry, struct snd_info_buffer *buf);
#endif


/*
@@ -276,12 +278,10 @@ info_read(struct snd_info_entry *entry, struct snd_info_buffer *buf)
	up(&register_mutex);
}

#endif /* CONFIG_PROC_FS */

static int __init
register_proc(void)
{
#ifdef CONFIG_PROC_FS
	struct snd_info_entry *entry;

	entry = snd_info_create_module_entry(THIS_MODULE, SNDRV_SEQ_OSS_PROCNAME, snd_seq_root);
@@ -297,16 +297,14 @@ register_proc(void)
		return -ENOMEM;
	}
	info_entry = entry;
#endif
	return 0;
}

static void
unregister_proc(void)
{
#ifdef CONFIG_PROC_FS
	if (info_entry)
		snd_info_unregister(info_entry);
	info_entry = NULL;
#endif
}
#endif /* CONFIG_PROC_FS */
+2 −1
Original line number Diff line number Diff line
@@ -502,6 +502,7 @@ snd_seq_oss_reset(struct seq_oss_devinfo *dp)
}


#ifdef CONFIG_PROC_FS
/*
 * misc. functions for proc interface
 */
@@ -552,4 +553,4 @@ snd_seq_oss_system_info_read(struct snd_info_buffer *buf)
			snd_seq_oss_readq_info_read(dp->readq, buf);
	}
}
#endif /* CONFIG_PROC_FS */
+2 −1
Original line number Diff line number Diff line
@@ -668,6 +668,7 @@ snd_seq_oss_midi_make_info(struct seq_oss_devinfo *dp, int dev, struct midi_info
}


#ifdef CONFIG_PROC_FS
/*
 * proc interface
 */
@@ -707,4 +708,4 @@ snd_seq_oss_midi_info_read(struct snd_info_buffer *buf)
		snd_use_lock_free(&mdev->use_lock);
	}
}
#endif /* CONFIG_PROC_FS */
Loading