All of lore.kernel.org
 help / color / mirror / Atom feed
* snd_assert() removal
@ 2008-08-13 10:16 Rene Herman
  2008-08-13 12:56 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Rene Herman @ 2008-08-13 10:16 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: ALSA devel

Hi Takashi.

Just see the snd_assert() removal. Much better as far as I'm concerned 
but just as a remark -- there's many combined ones of the form:

diff --git a/sound/isa/cs423x/cs4236_lib.c b/sound/isa/cs423x/cs4236_lib.c
index 33e9cf1..6a85fdc 100644
--- a/sound/isa/cs423x/cs4236_lib.c
+++ b/sound/isa/cs423x/cs4236_lib.c
@@ -967,7 +967,8 @@ int snd_cs4236_mixer(struct snd_wss *chip)
         int err;
         struct snd_kcontrol_new *kcontrol;

-       snd_assert(chip != NULL && chip->card != NULL, return -EINVAL);
+       if (snd_BUG_ON(!chip || !chip->card))
+               return -EINVAL;
         card = chip->card;
         strcpy(card->mixername, snd_wss_chip_id(chip));

in there. Just thought I'd point that Andrew Morton has been pushing 
back on multiple conditions per regular BUG_ON()/WARN_ON() lately as 
they end up giving less useful information then split ones ("so what 
triggered?").

Just a remark as said but if you agree with him, maybe now is the best 
time to split them directly as well.

Rene.

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: snd_assert() removal
  2008-08-13 10:16 snd_assert() removal Rene Herman
@ 2008-08-13 12:56 ` Takashi Iwai
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2008-08-13 12:56 UTC (permalink / raw)
  To: Rene Herman; +Cc: ALSA devel

At Wed, 13 Aug 2008 12:16:33 +0200,
Rene Herman wrote:
> 
> Hi Takashi.
> 
> Just see the snd_assert() removal. Much better as far as I'm concerned 
> but just as a remark -- there's many combined ones of the form:
> 
> diff --git a/sound/isa/cs423x/cs4236_lib.c b/sound/isa/cs423x/cs4236_lib.c
> index 33e9cf1..6a85fdc 100644
> --- a/sound/isa/cs423x/cs4236_lib.c
> +++ b/sound/isa/cs423x/cs4236_lib.c
> @@ -967,7 +967,8 @@ int snd_cs4236_mixer(struct snd_wss *chip)
>          int err;
>          struct snd_kcontrol_new *kcontrol;
> 
> -       snd_assert(chip != NULL && chip->card != NULL, return -EINVAL);
> +       if (snd_BUG_ON(!chip || !chip->card))
> +               return -EINVAL;
>          card = chip->card;
>          strcpy(card->mixername, snd_wss_chip_id(chip));
> 
> in there. Just thought I'd point that Andrew Morton has been pushing 
> back on multiple conditions per regular BUG_ON()/WARN_ON() lately as 
> they end up giving less useful information then split ones ("so what 
> triggered?").

That's true.

> Just a remark as said but if you agree with him, maybe now is the best 
> time to split them directly as well.

Well, I don't mind to apply more patches now ;)


Takashi

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-08-13 12:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-13 10:16 snd_assert() removal Rene Herman
2008-08-13 12:56 ` Takashi Iwai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.