LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* sound/core.h: evil #ifdefs
@ 2008-03-29 20:57 Pavel Machek
2008-03-29 21:00 ` Harvey Harrison
0 siblings, 1 reply; 3+ messages in thread
From: Pavel Machek @ 2008-03-29 20:57 UTC (permalink / raw)
To: perex, kernel list, Trivial patch monkey, tiwai
snd_minor_info_oss_* is an function returning int _or_ comment,
depending on config parameters. That is truly evil, fix it.
Signed-off-by: Pavel Machek <pavel@suse.cz>
diff --git a/include/sound/core.h b/include/sound/core.h
index 4fc0235..452000d 100644
--- a/include/sound/core.h
+++ b/include/sound/core.h
@@ -277,8 +277,8 @@ #ifdef CONFIG_SND_OSSEMUL
int snd_minor_info_oss_init(void);
int snd_minor_info_oss_done(void);
#else
-#define snd_minor_info_oss_init() /*NOP*/
-#define snd_minor_info_oss_done() /*NOP*/
+static inline snd_minor_info_oss_init(void) { return 0; }
+static inline snd_minor_info_oss_done(void) { return 0; }
#endif
/* memory.c */
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: sound/core.h: evil #ifdefs
2008-03-29 20:57 sound/core.h: evil #ifdefs Pavel Machek
@ 2008-03-29 21:00 ` Harvey Harrison
2008-03-29 21:39 ` Pavel Machek
0 siblings, 1 reply; 3+ messages in thread
From: Harvey Harrison @ 2008-03-29 21:00 UTC (permalink / raw)
To: Pavel Machek; +Cc: perex, kernel list, Trivial patch monkey, tiwai
On Sat, 2008-03-29 at 21:57 +0100, Pavel Machek wrote:
> snd_minor_info_oss_* is an function returning int _or_ comment,
> depending on config parameters. That is truly evil, fix it.
>
> Signed-off-by: Pavel Machek <pavel@suse.cz>
>
> diff --git a/include/sound/core.h b/include/sound/core.h
> index 4fc0235..452000d 100644
> --- a/include/sound/core.h
> +++ b/include/sound/core.h
> @@ -277,8 +277,8 @@ #ifdef CONFIG_SND_OSSEMUL
> int snd_minor_info_oss_init(void);
> int snd_minor_info_oss_done(void);
> #else
> -#define snd_minor_info_oss_init() /*NOP*/
> -#define snd_minor_info_oss_done() /*NOP*/
> +static inline snd_minor_info_oss_init(void) { return 0; }
static inline int snd_minor_info_oss_init(void) { return 0; }
> +static inline snd_minor_info_oss_done(void) { return 0; }
static inline int snd_minor_info_oss_done(void) { return 0; }
> #endif
>
> /* memory.c */
>
Cheers,
Harvey
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: sound/core.h: evil #ifdefs
2008-03-29 21:00 ` Harvey Harrison
@ 2008-03-29 21:39 ` Pavel Machek
0 siblings, 0 replies; 3+ messages in thread
From: Pavel Machek @ 2008-03-29 21:39 UTC (permalink / raw)
To: Harvey Harrison; +Cc: perex, kernel list, Trivial patch monkey, tiwai
Hi!
> > snd_minor_info_oss_* is an function returning int _or_ comment,
> > depending on config parameters. That is truly evil, fix it.
> >
> > Signed-off-by: Pavel Machek <pavel@suse.cz>
> >
> > diff --git a/include/sound/core.h b/include/sound/core.h
> > index 4fc0235..452000d 100644
> > --- a/include/sound/core.h
> > +++ b/include/sound/core.h
> > @@ -277,8 +277,8 @@ #ifdef CONFIG_SND_OSSEMUL
> > int snd_minor_info_oss_init(void);
> > int snd_minor_info_oss_done(void);
> > #else
> > -#define snd_minor_info_oss_init() /*NOP*/
> > -#define snd_minor_info_oss_done() /*NOP*/
> > +static inline snd_minor_info_oss_init(void) { return 0; }
> static inline int snd_minor_info_oss_init(void) { return 0; }
>
> > +static inline snd_minor_info_oss_done(void) { return 0; }
> static inline int snd_minor_info_oss_done(void) { return 0; }
> > #endif
yep, thanks, scratch that patch.
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-03-29 21:39 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-29 20:57 sound/core.h: evil #ifdefs Pavel Machek
2008-03-29 21:00 ` Harvey Harrison
2008-03-29 21:39 ` Pavel Machek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).