All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Jiri Slaby <jslaby@suse.cz>
Cc: jirislaby@gmail.com, perex@perex.cz, alsa-devel@alsa-project.org,
	linux-kernel@vger.kernel.org, Andreas Mohr <andi@lisas.de>
Subject: Re: [PATCH 1/1] SOUND: azt3328, fix broken AZF_FMT_XLATE macro
Date: Sat, 22 Jan 2011 17:26:39 +0100	[thread overview]
Message-ID: <s5h1v44j45c.wl%tiwai@suse.de> (raw)
In-Reply-To: <1295704570-27015-1-git-send-email-jslaby@suse.cz>

At Sat, 22 Jan 2011 14:56:10 +0100,
Jiri Slaby wrote:
> 
> Despite the AZF_FMT_XLATE macro looks totally weird and useless, it's
> heavily broken (apart it also broke my parser).
> 
> The 'break' in the macro belongs to the do-while loop and not to the
> switch. So it always falls through the all cases till the end.
> 
> Remove the do-while from the macro.
> 
> Also people should terminate statements with semicolons. So force
> people to do so by removing the last one in the macro.
> 
> I vote for removing that crap completely because it makes the code
> weird anyway -- you have to specify manually both of freq and bits
> which is I would expect to be avoided exactly by such a macro.

I agree.  Andreas, please either revert back to the plain code,
or use a simple look-up table if you don't want switch/case.


thanks,

Takashi

WARNING: multiple messages have this Message-ID (diff)
From: Takashi Iwai <tiwai@suse.de>
To: Jiri Slaby <jslaby@suse.cz>
Cc: linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org,
	jirislaby@gmail.com, Andreas Mohr <andi@lisas.de>
Subject: Re: [PATCH 1/1] SOUND: azt3328, fix broken AZF_FMT_XLATE macro
Date: Sat, 22 Jan 2011 17:26:39 +0100	[thread overview]
Message-ID: <s5h1v44j45c.wl%tiwai@suse.de> (raw)
In-Reply-To: <1295704570-27015-1-git-send-email-jslaby@suse.cz>

At Sat, 22 Jan 2011 14:56:10 +0100,
Jiri Slaby wrote:
> 
> Despite the AZF_FMT_XLATE macro looks totally weird and useless, it's
> heavily broken (apart it also broke my parser).
> 
> The 'break' in the macro belongs to the do-while loop and not to the
> switch. So it always falls through the all cases till the end.
> 
> Remove the do-while from the macro.
> 
> Also people should terminate statements with semicolons. So force
> people to do so by removing the last one in the macro.
> 
> I vote for removing that crap completely because it makes the code
> weird anyway -- you have to specify manually both of freq and bits
> which is I would expect to be avoided exactly by such a macro.

I agree.  Andreas, please either revert back to the plain code,
or use a simple look-up table if you don't want switch/case.


thanks,

Takashi

  reply	other threads:[~2011-01-22 16:26 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-22 13:56 [PATCH 1/1] SOUND: azt3328, fix broken AZF_FMT_XLATE macro Jiri Slaby
2011-01-22 16:26 ` Takashi Iwai [this message]
2011-01-22 16:26   ` Takashi Iwai
2011-01-25  5:46   ` [PATCH] azt3328: repair breakage (Re: [PATCH 1/1] SOUND: azt3328, fix broken AZF_FMT_XLATE macro) Andreas Mohr
2011-01-25  5:46     ` Andreas Mohr
2011-01-25  7:13     ` Takashi Iwai
2011-01-25  7:13       ` Takashi Iwai
2011-01-25  8:23     ` Jiri Slaby
2011-01-25  9:40       ` Takashi Iwai
2011-01-25  9:40         ` Takashi Iwai
2011-01-22 20:01 ` [PATCH 1/1] SOUND: azt3328, fix broken AZF_FMT_XLATE macro Andreas Mohr
2011-01-22 20:01   ` Andreas Mohr

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=s5h1v44j45c.wl%tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=andi@lisas.de \
    --cc=jirislaby@gmail.com \
    --cc=jslaby@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.