aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2008-08-08 11:14:55 -0400
committerJaroslav Kysela <perex@perex.cz>2008-08-13 05:46:42 -0400
commit7cc6dffdae28058f5953fac5743b6abf705d4f05 (patch)
treeb25eb39a031f4955d885aba9cb972157475acc5c
parent5e246b850df563224be26f1d409cf66fd6c968df (diff)
ALSA: Kill snd_assert() definition
Remove snd_assert() completely now. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
-rw-r--r--Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl29
-rw-r--r--include/sound/core.h19
2 files changed, 1 insertions, 47 deletions
diff --git a/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl b/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl
index df699e4323ef..b54cb5048dfa 100644
--- a/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl
+++ b/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl
@@ -6135,38 +6135,11 @@ struct _snd_pcm_runtime {
6135 </para> 6135 </para>
6136 </section> 6136 </section>
6137 6137
6138 <section id="useful-functions-snd-assert">
6139 <title><function>snd_assert()</function></title>
6140 <para>
6141 <function>snd_assert()</function> macro is similar with the
6142 normal <function>assert()</function> macro. For example,
6143
6144 <informalexample>
6145 <programlisting>
6146<![CDATA[
6147 snd_assert(pointer != NULL, return -EINVAL);
6148]]>
6149 </programlisting>
6150 </informalexample>
6151 </para>
6152
6153 <para>
6154 The first argument is the expression to evaluate, and the
6155 second argument is the action if it fails. When
6156 <constant>CONFIG_SND_DEBUG</constant>, is set, it will show an
6157 error message such as <computeroutput>BUG? (xxx)</computeroutput>
6158 together with stack trace.
6159 </para>
6160 <para>
6161 When no debug flag is set, this macro is ignored.
6162 </para>
6163 </section>
6164
6165 <section id="useful-functions-snd-bug"> 6138 <section id="useful-functions-snd-bug">
6166 <title><function>snd_BUG()</function></title> 6139 <title><function>snd_BUG()</function></title>
6167 <para> 6140 <para>
6168 It shows the <computeroutput>BUG?</computeroutput> message and 6141 It shows the <computeroutput>BUG?</computeroutput> message and
6169 stack trace as well as <function>snd_assert</function> at the point. 6142 stack trace as well as <function>snd_BUG_ON</function> at the point.
6170 It's useful to show that a fatal error happens there. 6143 It's useful to show that a fatal error happens there.
6171 </para> 6144 </para>
6172 <para> 6145 <para>
diff --git a/include/sound/core.h b/include/sound/core.h
index 938c36a0e874..b3d8ac7c832b 100644
--- a/include/sound/core.h
+++ b/include/sound/core.h
@@ -368,8 +368,6 @@ void snd_verbose_printd(const char *file, int line, const char *format, ...)
368 368
369#ifdef CONFIG_SND_DEBUG 369#ifdef CONFIG_SND_DEBUG
370 370
371#define __ASTRING__(x) #x
372
373#ifdef CONFIG_SND_VERBOSE_PRINTK 371#ifdef CONFIG_SND_VERBOSE_PRINTK
374/** 372/**
375 * snd_printd - debug printk 373 * snd_printd - debug printk
@@ -384,22 +382,6 @@ void snd_verbose_printd(const char *file, int line, const char *format, ...)
384#define snd_printd(fmt, args...) \ 382#define snd_printd(fmt, args...) \
385 printk(fmt ,##args) 383 printk(fmt ,##args)
386#endif 384#endif
387/**
388 * snd_assert - run-time assertion macro
389 * @expr: expression
390 *
391 * This macro checks the expression in run-time and invokes the commands
392 * given in the rest arguments if the assertion is failed.
393 * When CONFIG_SND_DEBUG is not set, the expression is executed but
394 * not checked.
395 */
396#define snd_assert(expr, args...) do { \
397 if (unlikely(!(expr))) { \
398 snd_printk(KERN_ERR "BUG? (%s)\n", __ASTRING__(expr)); \
399 dump_stack(); \
400 args; \
401 } \
402} while (0)
403 385
404#define snd_BUG() do { \ 386#define snd_BUG() do { \
405 snd_printk(KERN_ERR "BUG?\n"); \ 387 snd_printk(KERN_ERR "BUG?\n"); \
@@ -411,7 +393,6 @@ void snd_verbose_printd(const char *file, int line, const char *format, ...)
411#else /* !CONFIG_SND_DEBUG */ 393#else /* !CONFIG_SND_DEBUG */
412 394
413#define snd_printd(fmt, args...) /* nothing */ 395#define snd_printd(fmt, args...) /* nothing */
414#define snd_assert(expr, args...) (void)(expr)
415#define snd_BUG() /* nothing */ 396#define snd_BUG() /* nothing */
416#define snd_BUG_ON(cond) ({/*(void)(cond);*/ 0;}) /* always false */ 397#define snd_BUG_ON(cond) ({/*(void)(cond);*/ 0;}) /* always false */
417 398