Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757428AbbBFO4c (ORCPT ); Fri, 6 Feb 2015 09:56:32 -0500 Received: from cantor2.suse.de ([195.135.220.15]:47477 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755844AbbBFO43 (ORCPT ); Fri, 6 Feb 2015 09:56:29 -0500 Date: Fri, 06 Feb 2015 15:56:27 +0100 Message-ID: From: Takashi Iwai To: Chris Rorvick Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Stefan Hajnoczi Subject: Re: [PATCH 2/4] ALSA: line6: Pass toneport pointer to toneport_has_led() In-Reply-To: <1423234272-7348-3-git-send-email-chris@rorvick.com> References: <1423234272-7348-1-git-send-email-chris@rorvick.com> <1423234272-7348-3-git-send-email-chris@rorvick.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/24.4 (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 Content-Length: 1433 Lines: 44 At Fri, 6 Feb 2015 08:51:10 -0600, Chris Rorvick wrote: > > It is unlikely this function would ever be used in a context without a > pointer to a `struct usb_line6_toneport', so grab the device type from > it rather than having the caller do it. > > Signed-off-by: Chris Rorvick > --- > sound/usb/line6/toneport.c | 19 ++++++++++++------- > 1 file changed, 12 insertions(+), 7 deletions(-) > > diff --git a/sound/usb/line6/toneport.c b/sound/usb/line6/toneport.c > index de56180a..b2c0b2c 100644 > --- a/sound/usb/line6/toneport.c > +++ b/sound/usb/line6/toneport.c > @@ -278,12 +278,17 @@ static struct snd_kcontrol_new toneport_control_source = { > (void cmd_0x02(byte red, byte green) > */ > > -static bool toneport_has_led(enum line6_device_type type) > +static bool toneport_has_led(struct usb_line6_toneport *toneport) > { > - return > - (type == LINE6_GUITARPORT) || > - (type == LINE6_TONEPORT_GX); > + switch (toneport->type) { > + case LINE6_GUITARPORT: > + case LINE6_TONEPORT_GX: > /* add your device here if you are missing support for the LEDs */ > + return 1; > + > + default: > + return 0; Please use true and false. Takashi -- 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/