lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <s5hh9uzw0kk.wl-tiwai@suse.de>
Date:	Fri, 06 Feb 2015 15:56:27 +0100
From:	Takashi Iwai <tiwai@...e.de>
To:	Chris Rorvick <chris@...vick.com>
Cc:	alsa-devel@...a-project.org, linux-kernel@...r.kernel.org,
	Stefan Hajnoczi <stefanha@...il.com>
Subject: Re: [PATCH 2/4] ALSA: line6: Pass toneport pointer to toneport_has_led()

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 <chris@...vick.com>
> ---
>  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@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ