From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751724Ab1AVQ0l (ORCPT ); Sat, 22 Jan 2011 11:26:41 -0500 Received: from cantor2.suse.de ([195.135.220.15]:39860 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750882Ab1AVQ0k (ORCPT ); Sat, 22 Jan 2011 11:26:40 -0500 Date: Sat, 22 Jan 2011 17:26:39 +0100 Message-ID: From: Takashi Iwai To: Jiri Slaby Cc: jirislaby@gmail.com, perex@perex.cz, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Andreas Mohr Subject: Re: [PATCH 1/1] SOUND: azt3328, fix broken AZF_FMT_XLATE macro In-Reply-To: <1295704570-27015-1-git-send-email-jslaby@suse.cz> References: <1295704570-27015-1-git-send-email-jslaby@suse.cz> User-Agent: Wanderlust/2.15.6 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.7 Emacs/23.2 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: [PATCH 1/1] SOUND: azt3328, fix broken AZF_FMT_XLATE macro Date: Sat, 22 Jan 2011 17:26:39 +0100 Message-ID: References: <1295704570-27015-1-git-send-email-jslaby@suse.cz> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 309C3103800 for ; Sat, 22 Jan 2011 17:26:42 +0100 (CET) In-Reply-To: <1295704570-27015-1-git-send-email-jslaby@suse.cz> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@alsa-project.org Errors-To: alsa-devel-bounces@alsa-project.org To: Jiri Slaby Cc: linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, jirislaby@gmail.com, Andreas Mohr List-Id: alsa-devel@alsa-project.org 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