From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark Brown Subject: Re: [RFC] [PATCH 3/3] ASoC: add support for Amstrad E3 (Delta) machine Date: Wed, 22 Jul 2009 13:19:26 +0100 Message-ID: <20090722121925.GE21171@rakim.wolfsonmicro.main> References: <200907220523.01107.jkrzyszt@tis.icnet.pl> <20090722110328.GB7622@sirena.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: 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: Takashi Iwai Cc: alsa-devel@alsa-project.org, Jonathan McDowell , Janusz Krzysztofik , Tony Lindgren , Peter Ujfalusi , "linux-kernel@vger.kernel.org" , e3-hacking@earth.li, Arun KS , "linux-serial@vger.kernel.org" , "linux-omap@vger.kernel.org" , Alan Cox List-Id: linux-omap@vger.kernel.org On Wed, Jul 22, 2009 at 01:39:22PM +0200, Takashi Iwai wrote: > Mark Brown wrote: > > > + /* Setup pins after corresponding bits if changed */ > > > + if ((bool)snd_soc_dapm_get_pin_status(codec, "Speaker") != > > > + (bool)(function & (1 << AMS_DELTA_SPEAKER))) { > > Don't like these casts... why are they needed? > Because the right side is the bit operation? Ick, yes. > The cast doesn't look nice, though... Indeed. I'd suggest rewriting to try to do less in the if statement - a helper function seems to be in order here since the same code is repeated several times with different pins and bitmasks.