From: Takashi Iwai <tiwai@suse.de>
To: Chris Rorvick <chris@rorvick.com>
Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org,
Stefan Hajnoczi <stefanha@gmail.com>
Subject: Re: [PATCH 2/4] ALSA: line6: Pass toneport pointer to toneport_has_led()
Date: Fri, 06 Feb 2015 15:56:27 +0100 [thread overview]
Message-ID: <s5hh9uzw0kk.wl-tiwai@suse.de> (raw)
In-Reply-To: <1423234272-7348-3-git-send-email-chris@rorvick.com>
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@rorvick.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
next prev parent reply other threads:[~2015-02-06 14:56 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-06 14:51 [PATCH 0/4] More Line 6 cleanup Chris Rorvick
2015-02-06 14:51 ` [PATCH 1/4] ALSA: line6: Add toneport_has_source_select() Chris Rorvick
2015-02-06 14:56 ` Takashi Iwai
2015-02-06 15:07 ` Chris Rorvick
2015-02-06 14:51 ` [PATCH 2/4] ALSA: line6: Pass toneport pointer to toneport_has_led() Chris Rorvick
2015-02-06 14:56 ` Takashi Iwai [this message]
2015-02-06 14:51 ` [PATCH 3/4] ALSA: line6: Pass driver name to line6_probe() Chris Rorvick
2015-02-06 15:04 ` Takashi Iwai
2015-02-06 17:23 ` Takashi Iwai
2015-02-07 16:18 ` Chris Rorvick
2015-02-06 14:51 ` [PATCH 4/4] ALSA: line6: Remove `usb_' prefix from structs Chris Rorvick
2015-02-06 15:11 ` Takashi Iwai
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=s5hh9uzw0kk.wl-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@alsa-project.org \
--cc=chris@rorvick.com \
--cc=linux-kernel@vger.kernel.org \
--cc=stefanha@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®