sound/core/: possible cleanups
PATCH 1/1 sound/core/: possible cleanups
This patch contains the following possible cleanups:
- make needlessly global code static
- #if 0 the following unused global functions:
- pcm_lib.c: snd_pcm_hw_param_any
- pcm_lib.c: snd_pcm_hw_params_any
- pcm_lib.c: snd_pcm_hw_param_setinteger
- pcm_misc.c: snd_pcm_format_cpu_endian
- pcm_misc.c: snd_pcm_format_size
- seq/seq_midi_event.c: snd_midi_event_init
- seq/seq_midi_event.c: snd_midi_event_resize_buffer
- seq/seq_virmidi.c: snd_virmidi_receive
- timer.c: snd_timer_system_resolution
- remove the following unneeded EXPORT_SYMBOL's:
- pcm_lib.c: snd_interval_muldivk
- pcm_lib.c: snd_interval_mulkdiv
- pcm_lib.c: snd_interval_div
- pcm_lib.c: snd_pcm_hw_params
- pcm.c: snd_pcm_start
- pcm.c: snd_pcm_suspend
- rawmidi.c: snd_rawmidi_drop_output
- rawmidi.c: snd_rawmidi_drain_input
- rawmidi.c: snd_rawmidi_info
- seq/seq_midi_event.c: snd_midi_event_resize_buffer
- seq/seq_midi_event.c: snd_midi_event_init
- seq/seq_virmidi.c: snd_virmidi_receive
- timer.c: snd_timer_continue
- timer.c: snd_timer_system_resolution
- sound.c: snd_device_free_all
Please check which of these changes do make sense and which might conflict with pending patches.
---
include/sound/core.h | 1 include/sound/pcm.h | 20 ------------ include/sound/rawmidi.h | 2 - include/sound/seq_midi_event.h | 2 - include/sound/seq_virmidi.h | 1 include/sound/timer.h | 3 - sound/core/device.c | 2 - sound/core/pcm.c | 2 - sound/core/pcm_lib.c | 52 +++++++++++++++++--------------- sound/core/pcm_memory.c | 2 - sound/core/pcm_misc.c | 4 ++ sound/core/pcm_native.c | 6 +-- sound/core/rawmidi.c | 10 ++---- sound/core/seq/seq_midi_event.c | 6 ++- sound/core/seq/seq_queue.c | 3 + sound/core/seq/seq_queue.h | 1 sound/core/seq/seq_timer.c | 3 + sound/core/seq/seq_timer.h | 2 - sound/core/seq/seq_virmidi.c | 4 +- sound/core/sound.c | 1 sound/core/timer.c | 8 ++-- 21 files changed, 56 insertions(+), 79 deletions(-)
include/sound/core.h renamed from include/sound/core.h.old +0 -1
@@ -350,7 +350,6 @@ void *device_data, snd_device_ops_t *ops);int snd_device_register (snd_card_t *card,void *device_data);int snd_device_register_all (snd_card_t *card); -int snd_device_disconnect (snd_card_t *card,void *device_data);int snd_device_disconnect_all (snd_card_t *card);int snd_device_free (snd_card_t *card,void *device_data);int snd_device_free_all (snd_card_t *card,snd_device_cmd_t cmd);
sound/core/device.c renamed from sound/core/device.c.old +1 -1
@@ -114,7 +114,7 @@* Returns zero if successful, or a negative error code on failure or if the * device not found. */ -int snd_device_disconnect (snd_card_t *card,void *device_data) +static int snd_device_disconnect (snd_card_t *card,void *device_data) {struct list_head *list;snd_device_t *dev;
include/sound/pcm.h renamed from include/sound/pcm.h.old +0 -20
@@ -491,7 +491,6 @@int snd_pcm_stop (snd_pcm_substream_t *substream,int status);int snd_pcm_drain_done (snd_pcm_substream_t *substream);#ifdef CONFIG_PM -int snd_pcm_suspend (snd_pcm_substream_t *substream);int snd_pcm_suspend_all (snd_pcm_t *pcm);#endif int snd_pcm_kernel_playback_ioctl (snd_pcm_substream_t *substream,unsigned int cmd,void *arg);
@@ -848,23 +847,6 @@void _snd_pcm_hw_params_any (snd_pcm_hw_params_t *params);void _snd_pcm_hw_param_setempty (snd_pcm_hw_params_t *params,snd_pcm_hw_param_t var); -int snd_pcm_hw_param_min (snd_pcm_substream_t *substream, -snd_pcm_hw_params_t *params, -snd_pcm_hw_param_t var, -unsigned int val,int *dir); -int snd_pcm_hw_param_max (snd_pcm_substream_t *substream, -snd_pcm_hw_params_t *params, -snd_pcm_hw_param_t var, -unsigned int val,int *dir); -int snd_pcm_hw_param_setinteger (snd_pcm_substream_t *substream, -snd_pcm_hw_params_t *params, -snd_pcm_hw_param_t var); -int snd_pcm_hw_param_first (snd_pcm_substream_t *substream, -snd_pcm_hw_params_t *params, -snd_pcm_hw_param_t var,int *dir); -int snd_pcm_hw_param_last (snd_pcm_substream_t *substream, -snd_pcm_hw_params_t *params, -snd_pcm_hw_param_t var,int *dir); int snd_pcm_hw_param_near(snd_pcm_substream_t *substream, snd_pcm_hw_params_t *params, snd_pcm_hw_param_t var,
@@ -876,7 +858,6 @@int snd_pcm_hw_params_choose (snd_pcm_substream_t *substream,snd_pcm_hw_params_t *params);int snd_pcm_hw_refine (snd_pcm_substream_t *substream,snd_pcm_hw_params_t *params); -int snd_pcm_hw_params (snd_pcm_substream_t *substream,snd_pcm_hw_params_t *params);int snd_pcm_hw_constraints_init (snd_pcm_substream_t *substream);int snd_pcm_hw_constraints_complete (snd_pcm_substream_t *substream);
@@ -985,7 +966,6 @@* Memory */ -int snd_pcm_lib_preallocate_free (snd_pcm_substream_t *substream);int snd_pcm_lib_preallocate_free_for_all (snd_pcm_t *pcm); int snd_pcm_lib_preallocate_pages(snd_pcm_substream_t *substream, int type, struct device *data,
sound/core/pcm_lib.c renamed from sound/core/pcm_lib.c.old +29 -23
148 lines not on this page · raw message
sound/core/pcm_memory.c renamed from sound/core/pcm_memory.c.old +1 -1
@@ -97,7 +97,7 @@* * Returns zero if successful, or a negative error code on failure. */ -int snd_pcm_lib_preallocate_free (snd_pcm_substream_t *substream) +static int snd_pcm_lib_preallocate_free (snd_pcm_substream_t *substream) {snd_pcm_lib_preallocate_dma_free (substream);if (substream->proc_prealloc_entry) {
sound/core/pcm_misc.c renamed from sound/core/pcm_misc.c.old +4 -0
@@ -276,6 +276,7 @@* Returns 1 if the given PCM format is CPU-endian, 0 if * opposite, or a negative error code if endian not specified. */ +#if 0 int snd_pcm_format_cpu_endian (snd_pcm_format_t format) {#ifdef SNDRV_LITTLE_ENDIAN
@@ -284,6 +285,7 @@return snd_pcm_format_big_endian (format); #endif } +#endif /* 0 */ /** * snd_pcm_format_width - return the bit-width of the format
@@ -326,6 +328,7 @@* Returns the byte size of the given samples for the format, or a * negative error code if unknown format. */ +#if 0 ssize_t snd_pcm_format_size (snd_pcm_format_t format,size_t samples) {int phys_width =snd_pcm_format_physical_width (format);
@@ -333,6 +336,7 @@return -EINVAL ; return samples * phys_width / 8; } +#endif /* 0 */ /** * snd_pcm_format_silence_64 - return the silent data in 8 bytes array
sound/core/pcm_native.c renamed from sound/core/pcm_native.c.old +3 -3
@@ -337,8 +337,8 @@return err; } -int snd_pcm_hw_params (snd_pcm_substream_t *substream, -snd_pcm_hw_params_t *params) +static int snd_pcm_hw_params (snd_pcm_substream_t *substream, +snd_pcm_hw_params_t *params) {snd_pcm_runtime_t *runtime;int err;
@@ -1044,7 +1044,7 @@* Trigger SUSPEND to all linked streams. * After this call, all streams are changed to SUSPENDED state. */ -int snd_pcm_suspend (snd_pcm_substream_t *substream) +static int snd_pcm_suspend (snd_pcm_substream_t *substream) {int err;unsigned long flags;
sound/core/pcm.c renamed from sound/core/pcm.c.old +0 -2
@@ -1049,9 +1049,7 @@EXPORT_SYMBOL (snd_pcm_format_name);/* pcm_native.c */ EXPORT_SYMBOL (snd_pcm_link_rwlock); -EXPORT_SYMBOL (snd_pcm_start);#ifdef CONFIG_PM -EXPORT_SYMBOL (snd_pcm_suspend);EXPORT_SYMBOL (snd_pcm_suspend_all);#endif EXPORT_SYMBOL (snd_pcm_kernel_playback_ioctl);
include/sound/rawmidi.h renamed from include/sound/rawmidi.h.old +0 -2
@@ -171,9 +171,7 @@int snd_rawmidi_kernel_release (snd_rawmidi_file_t * rfile);int snd_rawmidi_output_params (snd_rawmidi_substream_t * substream,snd_rawmidi_params_t * params);int snd_rawmidi_input_params (snd_rawmidi_substream_t * substream,snd_rawmidi_params_t * params); -int snd_rawmidi_drop_output (snd_rawmidi_substream_t * substream);int snd_rawmidi_drain_output (snd_rawmidi_substream_t * substream); -int snd_rawmidi_drain_input (snd_rawmidi_substream_t * substream);long snd_rawmidi_kernel_read (snd_rawmidi_substream_t * substream,unsigned char *buf,long count);long snd_rawmidi_kernel_write (snd_rawmidi_substream_t * substream,const unsigned char *buf,long count);
sound/core/rawmidi.c renamed from sound/core/rawmidi.c.old +4 -6
@@ -156,7 +156,7 @@tasklet_kill (&substream->runtime->tasklet); } -int snd_rawmidi_drop_output (snd_rawmidi_substream_t * substream) +static int snd_rawmidi_drop_output (snd_rawmidi_substream_t * substream) {unsigned long flags;snd_rawmidi_runtime_t *runtime = substream->runtime;
@@ -199,7 +199,7 @@return err; } -int snd_rawmidi_drain_input (snd_rawmidi_substream_t * substream) +static int snd_rawmidi_drain_input (snd_rawmidi_substream_t * substream) {unsigned long flags;snd_rawmidi_runtime_t *runtime = substream->runtime;
@@ -532,7 +532,8 @@return err; } -int snd_rawmidi_info (snd_rawmidi_substream_t *substream,snd_rawmidi_info_t *info) +static int snd_rawmidi_info (snd_rawmidi_substream_t *substream, +snd_rawmidi_info_t *info) {snd_rawmidi_t *rmidi;
@@ -1662,9 +1663,7 @@EXPORT_SYMBOL (snd_rawmidi_output_params);EXPORT_SYMBOL (snd_rawmidi_input_params); -EXPORT_SYMBOL (snd_rawmidi_drop_output);EXPORT_SYMBOL (snd_rawmidi_drain_output); -EXPORT_SYMBOL (snd_rawmidi_drain_input);EXPORT_SYMBOL (snd_rawmidi_receive);EXPORT_SYMBOL (snd_rawmidi_transmit_empty);EXPORT_SYMBOL (snd_rawmidi_transmit_peek);
@@ -1672,7 +1671,6 @@EXPORT_SYMBOL (snd_rawmidi_transmit);EXPORT_SYMBOL (snd_rawmidi_new);EXPORT_SYMBOL (snd_rawmidi_set_ops); -EXPORT_SYMBOL (snd_rawmidi_info);EXPORT_SYMBOL (snd_rawmidi_info_select);EXPORT_SYMBOL (snd_rawmidi_kernel_open);EXPORT_SYMBOL (snd_rawmidi_kernel_release);
include/sound/seq_midi_event.h renamed from include/sound/seq_midi_event.h.old +0 -2
@@ -41,9 +41,7 @@ };int snd_midi_event_new (int bufsize,snd_midi_event_t **rdev); -int snd_midi_event_resize_buffer (snd_midi_event_t *dev,int bufsize);void snd_midi_event_free (snd_midi_event_t *dev); -void snd_midi_event_init (snd_midi_event_t *dev);void snd_midi_event_reset_encode (snd_midi_event_t *dev);void snd_midi_event_reset_decode (snd_midi_event_t *dev);void snd_midi_event_no_status (snd_midi_event_t *dev,int on);
sound/core/seq/seq_midi_event.c renamed from sound/core/seq/seq_midi_event.c.old +4 -2
@@ -171,11 +171,13 @@spin_unlock_irqrestore (&dev->lock, flags); } +#if 0 void snd_midi_event_init (snd_midi_event_t *dev) {snd_midi_event_reset_encode (dev);snd_midi_event_reset_decode (dev); } +#endif /* 0 */ void snd_midi_event_no_status (snd_midi_event_t *dev,int on) {
@@ -185,6 +187,7 @@/* * resize buffer */ +#if 0 int snd_midi_event_resize_buffer (snd_midi_event_t *dev,int bufsize) {unsigned char *new_buf, *old_buf;
@@ -204,6 +207,7 @@kfree (old_buf); return 0; } +#endif /* 0 */ /* * read bytes and encode to sequencer event if finished
@@ -517,8 +521,6 @@EXPORT_SYMBOL (snd_midi_event_new);EXPORT_SYMBOL (snd_midi_event_free); -EXPORT_SYMBOL (snd_midi_event_resize_buffer); -EXPORT_SYMBOL (snd_midi_event_init);EXPORT_SYMBOL (snd_midi_event_reset_encode);EXPORT_SYMBOL (snd_midi_event_reset_decode);EXPORT_SYMBOL (snd_midi_event_no_status);
sound/core/seq/seq_queue.h renamed from sound/core/seq/seq_queue.h.old +0 -1
@@ -111,7 +111,6 @@int snd_seq_queue_is_used (int queueid,int client);int snd_seq_control_queue (snd_seq_event_t *ev,int atomic,int hop); -void snd_seq_queue_process_event (queue_t *q,snd_seq_event_t *ev,int atomic,int hop);/* * 64bit division - for sync stuff..
sound/core/seq/seq_queue.c renamed from sound/core/seq/seq_queue.c.old +2 -1
@@ -672,7 +672,8 @@* process a received queue-control event. * this function is exported for seq_sync.c. */ -void snd_seq_queue_process_event (queue_t *q,snd_seq_event_t *ev,int atomic,int hop) +static void snd_seq_queue_process_event (queue_t *q,snd_seq_event_t *ev, +int atomic,int hop) {switch (ev->type) {case SNDRV_SEQ_EVENT_START :
sound/core/seq/seq_timer.h renamed from sound/core/seq/seq_timer.h.old +0 -2
@@ -64,8 +64,6 @@/* delete timer (destructor) */ extern void snd_seq_timer_delete (seq_timer_t **tmr); -void snd_seq_timer_set_tick_resolution (seq_timer_tick_t *tick,int tempo,int ppq,int nticks); -/* */ static inline void snd_seq_timer_update_tick (seq_timer_tick_t *tick,unsigned long resolution) {
sound/core/seq/seq_timer.c renamed from sound/core/seq/seq_timer.c.old +2 -1
@@ -36,7 +36,8 @@#define SKEW_BASE 0x10000/* 16bit shift */ -void snd_seq_timer_set_tick_resolution (seq_timer_tick_t *tick,int tempo,int ppq,int nticks) +static void snd_seq_timer_set_tick_resolution (seq_timer_tick_t *tick, +int tempo,int ppq,int nticks) {if (tempo <1000000 ) tick->resolution = (tempo *1000 ) / ppq;
include/sound/seq_virmidi.h renamed from include/sound/seq_virmidi.h.old +0 -1
@@ -79,6 +79,5 @@#define SNDRV_VIRMIDI_SEQ_DISPATCH 2int snd_virmidi_new (snd_card_t *card,int device,snd_rawmidi_t **rrmidi); -int snd_virmidi_receive (snd_rawmidi_t *rmidi,snd_seq_event_t *ev);#endif /* __SOUND_SEQ_VIRMIDI */
sound/core/seq/seq_virmidi.c renamed from sound/core/seq/seq_virmidi.c.old +2 -2
@@ -110,7 +110,7 @@* handler of a remote port which is attached to the virmidi via * SNDRV_VIRMIDI_SEQ_ATTACH. */ -/* exported */ +#if 0 int snd_virmidi_receive (snd_rawmidi_t *rmidi,snd_seq_event_t *ev) {snd_virmidi_dev_t *rdev;
@@ -118,6 +118,7 @@ rdev = rmidi->private_data; return snd_virmidi_dev_receive_event(rdev, ev); } +#endif /* 0 */ /* * event handler of virmidi port
@@ -548,4 +549,3 @@module_exit (alsa_virmidi_exit)EXPORT_SYMBOL (snd_virmidi_new); -EXPORT_SYMBOL (snd_virmidi_receive);
include/sound/timer.h renamed from include/sound/timer.h.old +0 -3
@@ -147,11 +147,8 @@extern unsigned long snd_timer_resolution (snd_timer_instance_t * timeri);extern int snd_timer_start (snd_timer_instance_t * timeri,unsigned int ticks);extern int snd_timer_stop (snd_timer_instance_t * timeri); -extern int snd_timer_continue (snd_timer_instance_t * timeri);extern int snd_timer_pause (snd_timer_instance_t * timeri);extern void snd_timer_interrupt (snd_timer_t * timer,unsigned long ticks_left); -extern unsigned int snd_timer_system_resolution (void ); -#endif /* __SOUND_TIMER_H */
sound/core/timer.c renamed from sound/core/timer.c.old +4 -4
@@ -534,7 +534,7 @@/* * start again.. the tick is kept. */ -int snd_timer_continue (snd_timer_instance_t * timeri) +static int snd_timer_continue (snd_timer_instance_t * timeri) {snd_timer_t *timer;int result = -EINVAL ;
@@ -846,7 +846,7 @@return 0 ; } -int snd_timer_unregister (snd_timer_t *timer) +static int snd_timer_unregister (snd_timer_t *timer) {struct list_head *p, *n;snd_timer_instance_t *ti;
@@ -947,10 +947,12 @@unsigned long correction; }; +#if 0 unsigned int snd_timer_system_resolution (void ) {return 1000000000L /HZ ; } +#endif /* 0 */ static void snd_timer_s_function (unsigned long data) {
@@ -1903,7 +1905,6 @@EXPORT_SYMBOL (snd_timer_resolution);EXPORT_SYMBOL (snd_timer_start);EXPORT_SYMBOL (snd_timer_stop); -EXPORT_SYMBOL (snd_timer_continue);EXPORT_SYMBOL (snd_timer_pause);EXPORT_SYMBOL (snd_timer_new);EXPORT_SYMBOL (snd_timer_notify);
@@ -1912,4 +1913,3 @@EXPORT_SYMBOL (snd_timer_global_register);EXPORT_SYMBOL (snd_timer_global_unregister);EXPORT_SYMBOL (snd_timer_interrupt); -EXPORT_SYMBOL (snd_timer_system_resolution);
sound/core/sound.c renamed from sound/core/sound.c.old +0 -1
@@ -431,7 +431,6 @@EXPORT_SYMBOL (snd_device_new);EXPORT_SYMBOL (snd_device_register);EXPORT_SYMBOL (snd_device_free); -EXPORT_SYMBOL (snd_device_free_all);/* isadma.c */ #ifdef CONFIG_ISA EXPORT_SYMBOL (snd_dma_program);
-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes Want to be the first software developer in space? Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click
At Wed, 18 May 2005 10:58:00 +0200,
Quoted 7 lines · Adrian Bunk
This patch contains the following possible cleanups:
- make needlessly global code static
- #if 0 the following unused global functions:
-pcm_lib.c:snd_pcm_hw_param_any
-pcm_lib.c:snd_pcm_hw_params_any
-pcm_lib.c:snd_pcm_hw_param_setinteger
Ack.
Quoted 2 lines
-
pcm_misc.c:snd_pcm_format_cpu_endian
-pcm_misc.c:snd_pcm_format_size
They are used by drivers which are not merged to kernel yet. Anyway, I moved the former one to a macro, and export the latter.
Quoted 3 lines
-
seq/seq_midi_event.c:snd_midi_event_init
-seq/seq_midi_event.c:snd_midi_event_resize_buffer
-seq/seq_virmidi.c:snd_virmidi_receive
Ack.
Quoted 1 line
-
timer.c:snd_timer_system_resolution
This one can be killed. The value is defined in the timer definition.
Quoted 6 lines
- remove the following unneeded EXPORT_SYMBOL's:
-pcm_lib.c:snd_interval_muldivk
-pcm_lib.c:snd_interval_mulkdiv
-pcm_lib.c:snd_interval_div
-pcm_lib.c:snd_pcm_hw_params
-pcm.c:snd_pcm_start
Ack.
Quoted 1 line
-
pcm.c:snd_pcm_suspend
I'd like to keep it global.
Quoted 3 lines
-
rawmidi.c:snd_rawmidi_drop_output
-rawmidi.c:snd_rawmidi_drain_input
-rawmidi.c:snd_rawmidi_info
Let's keep them. Rawmidi can be referred from out-of-kernel drivers.
Quoted 3 lines
-
seq/seq_midi_event.c:snd_midi_event_resize_buffer
-seq/seq_midi_event.c:snd_midi_event_init
-seq/seq_virmidi.c:snd_virmidi_receive
Ack.
Quoted 1 line
-
timer.c:snd_timer_continue
Let's keep this, too. This might be referred.
Quoted 2 lines
-
timer.c:snd_timer_system_resolution
-sound.c:snd_device_free_all
Ack.
I'll fix the above on ALSA tree.
Thanks.
Takashi
-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes Want to be the first software developer in space? Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click