Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Cc: alsa-devel@alsa-project.org, clemens@ladisch.de,
	ffado-devel@lists.sf.net
Subject: Re: [PATCH] ALSA: firewire-motu: remove invalid bitshift for register value
Date: Wed, 05 Apr 2017 21:38:33 +0200	[thread overview]
Message-ID: <s5hefx6bq6e.wl-tiwai@suse.de> (raw)
In-Reply-To: <20170403121350.19579-1-o-takashi@sakamocchi.jp>

On Mon, 03 Apr 2017 14:13:50 +0200,
Takashi Sakamoto wrote:
> 
> In protocol version 3, drivers can read current sampling clock status from
> register 0x'ffff'f000'0b14. 8 bits of LSB of this register represents type
> of signal as source of clock.
> 
> Current driver code includes invalid bitshift to handle the parameter. This
> commit fixes the bug.
> 
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Fixes: 5992e30034c4 ("ALSA: firewire-motu: add support for MOTU 828mk3 (FireWire/Hybrid) as a model with protocol version 3")
> Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>

Applied to for-next branch now.  Thanks.


Takashi

> ---
>  sound/firewire/motu/motu-protocol-v3.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/sound/firewire/motu/motu-protocol-v3.c b/sound/firewire/motu/motu-protocol-v3.c
> index b463da9..ddb6472 100644
> --- a/sound/firewire/motu/motu-protocol-v3.c
> +++ b/sound/firewire/motu/motu-protocol-v3.c
> @@ -14,7 +14,6 @@
>  #define  V3_CLOCK_RATE_MASK		0x0000ff00
>  #define  V3_CLOCK_RATE_SHIFT		8
>  #define  V3_CLOCK_SOURCE_MASK		0x000000ff
> -#define  V3_CLOCK_SOURCE_SHIFT		8
>  
>  #define V3_OPT_IFACE_MODE_OFFSET	0x0c94
>  #define  V3_ENABLE_OPT_IN_IFACE_A	0x00000001
> @@ -101,7 +100,7 @@ static int v3_get_clock_source(struct snd_motu *motu,
>  		return err;
>  	data = be32_to_cpu(reg);
>  
> -	val = (data & V3_CLOCK_SOURCE_MASK) >> V3_CLOCK_SOURCE_SHIFT;
> +	val = data & V3_CLOCK_SOURCE_MASK;
>  	if (val == 0x00) {
>  		*src = SND_MOTU_CLOCK_SOURCE_INTERNAL;
>  	} else if (val == 0x01) {
> -- 
> 2.9.3
> 

      reply	other threads:[~2017-04-05 19:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-03 12:13 [PATCH] ALSA: firewire-motu: remove invalid bitshift for register value Takashi Sakamoto
2017-04-05 19:38 ` Takashi Iwai [this message]

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=s5hefx6bq6e.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=clemens@ladisch.de \
    --cc=ffado-devel@lists.sf.net \
    --cc=o-takashi@sakamocchi.jp \
    /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