Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754052AbZGVMTa (ORCPT ); Wed, 22 Jul 2009 08:19:30 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751644AbZGVMT2 (ORCPT ); Wed, 22 Jul 2009 08:19:28 -0400 Received: from opensource.wolfsonmicro.com ([80.75.67.52]:48469 "EHLO opensource2.wolfsonmicro.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751040AbZGVMT1 (ORCPT ); Wed, 22 Jul 2009 08:19:27 -0400 Date: Wed, 22 Jul 2009 13:19:26 +0100 From: Mark Brown To: Takashi Iwai Cc: Janusz Krzysztofik , alsa-devel@alsa-project.org, Jonathan McDowell , 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 Subject: Re: [alsa-devel] [RFC] [PATCH 3/3] ASoC: add support for Amstrad E3 (Delta) machine 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-Disposition: inline In-Reply-To: X-Cookie: Biology grows on you. User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 862 Lines: 23 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. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/