diff options
author | Eliot Blennerhassett <eblennerhassett@audioscience.com> | 2011-07-21 23:52:44 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2011-07-22 01:50:03 -0400 |
commit | 0a17e993076f226aca3463a1c7fb9265e06ed2d3 (patch) | |
tree | edd7100033e14c34dba97c82276d6fae46160b45 /sound/pci/asihpi/asihpi.c | |
parent | 95a4c6e785bf7e2e5cde7f92c9252877b4fcea46 (diff) |
ALSA: asihpi - Revise snd_pcm_debug_name, get rid of DEBUG_NAME macro
Work towards moving the function into alsa common header.
Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/asihpi/asihpi.c')
-rw-r--r-- | sound/pci/asihpi/asihpi.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/sound/pci/asihpi/asihpi.c b/sound/pci/asihpi/asihpi.c index ddf882ed1dfb..378656d79164 100644 --- a/sound/pci/asihpi/asihpi.c +++ b/sound/pci/asihpi/asihpi.c | |||
@@ -50,19 +50,21 @@ MODULE_DESCRIPTION("AudioScience ALSA ASI5000 ASI6000 ASI87xx ASI89xx"); | |||
50 | #if defined CONFIG_SND_DEBUG | 50 | #if defined CONFIG_SND_DEBUG |
51 | /* copied from pcm_lib.c, hope later patch will make that version public | 51 | /* copied from pcm_lib.c, hope later patch will make that version public |
52 | and this copy can be removed */ | 52 | and this copy can be removed */ |
53 | static void pcm_debug_name(struct snd_pcm_substream *substream, | 53 | static inline void |
54 | char *name, size_t len) | 54 | snd_pcm_debug_name(struct snd_pcm_substream *substream, char *buf, size_t size) |
55 | { | 55 | { |
56 | snprintf(name, len, "pcmC%dD%d%c:%d", | 56 | snprintf(buf, size, "pcmC%dD%d%c:%d", |
57 | substream->pcm->card->number, | 57 | substream->pcm->card->number, |
58 | substream->pcm->device, | 58 | substream->pcm->device, |
59 | substream->stream ? 'c' : 'p', | 59 | substream->stream ? 'c' : 'p', |
60 | substream->number); | 60 | substream->number); |
61 | } | 61 | } |
62 | #define DEBUG_NAME(substream, name) char name[16]; pcm_debug_name(substream, name, sizeof(name)) | ||
63 | #else | 62 | #else |
64 | #define pcm_debug_name(s, n, l) do { } while (0) | 63 | static inline void |
65 | #define DEBUG_NAME(name, substream) do { } while (0) | 64 | snd_pcm_debug_name(struct snd_pcm_substream *substream, char *buf, size_t size) |
65 | { | ||
66 | *buf = 0; | ||
67 | } | ||
66 | #endif | 68 | #endif |
67 | 69 | ||
68 | #if defined CONFIG_SND_DEBUG_VERBOSE | 70 | #if defined CONFIG_SND_DEBUG_VERBOSE |
@@ -305,7 +307,8 @@ static u16 handle_error(u16 err, int line, char *filename) | |||
305 | static void print_hwparams(struct snd_pcm_substream *substream, | 307 | static void print_hwparams(struct snd_pcm_substream *substream, |
306 | struct snd_pcm_hw_params *p) | 308 | struct snd_pcm_hw_params *p) |
307 | { | 309 | { |
308 | DEBUG_NAME(substream, name); | 310 | char name[16]; |
311 | snd_pcm_debug_name(substream, name, sizeof(name)); | ||
309 | snd_printd("%s HWPARAMS\n", name); | 312 | snd_printd("%s HWPARAMS\n", name); |
310 | snd_printd(" samplerate %d Hz\n", params_rate(p)); | 313 | snd_printd(" samplerate %d Hz\n", params_rate(p)); |
311 | snd_printd(" channels %d\n", params_channels(p)); | 314 | snd_printd(" channels %d\n", params_channels(p)); |
@@ -577,8 +580,9 @@ static int snd_card_asihpi_trigger(struct snd_pcm_substream *substream, | |||
577 | struct snd_card_asihpi *card = snd_pcm_substream_chip(substream); | 580 | struct snd_card_asihpi *card = snd_pcm_substream_chip(substream); |
578 | struct snd_pcm_substream *s; | 581 | struct snd_pcm_substream *s; |
579 | u16 e; | 582 | u16 e; |
580 | DEBUG_NAME(substream, name); | 583 | char name[16]; |
581 | 584 | ||
585 | snd_pcm_debug_name(substream, name, sizeof(name)); | ||
582 | snd_printdd("%s trigger\n", name); | 586 | snd_printdd("%s trigger\n", name); |
583 | 587 | ||
584 | switch (cmd) { | 588 | switch (cmd) { |
@@ -742,7 +746,9 @@ static void snd_card_asihpi_timer_function(unsigned long data) | |||
742 | int loops = 0; | 746 | int loops = 0; |
743 | u16 state; | 747 | u16 state; |
744 | u32 buffer_size, bytes_avail, samples_played, on_card_bytes; | 748 | u32 buffer_size, bytes_avail, samples_played, on_card_bytes; |
745 | DEBUG_NAME(substream, name); | 749 | char name[16]; |
750 | |||
751 | snd_pcm_debug_name(substream, name, sizeof(name)); | ||
746 | 752 | ||
747 | snd_printdd("%s snd_card_asihpi_timer_function\n", name); | 753 | snd_printdd("%s snd_card_asihpi_timer_function\n", name); |
748 | 754 | ||