* [bug report] ASoC: cs35l34: Initial commit of the cs35l34 CODEC driver.
@ 2016-11-10 12:54 Dan Carpenter
2016-11-10 15:21 ` Handrigan, Paul
0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2016-11-10 12:54 UTC (permalink / raw)
To: Paul.Handrigan; +Cc: alsa-devel
Hello Paul Handrigan,
The patch c1124c09e103: "ASoC: cs35l34: Initial commit of the cs35l34
CODEC driver." from Oct 12, 2016, leads to the following static
checker warning:
sound/soc/codecs/cs35l34.c:613 cs35l34_dai_set_sysclk()
warn: odd binop '0xffffffffffffffef & 0x0'
sound/soc/codecs/cs35l34.c
604 static int cs35l34_dai_set_sysclk(struct snd_soc_dai *dai,
605 int clk_id, unsigned int freq, int dir)
606 {
607 struct snd_soc_codec *codec = dai->codec;
608 struct cs35l34_private *cs35l34 = snd_soc_codec_get_drvdata(codec);
609 unsigned int value;
610
611 switch (freq) {
612 case CS35L34_MCLK_5644:
613 value = ~CS35L34_MCLK_DIV & CS35L34_MCLK_RATE_5P6448;
^^^^^^^^^^^^^^^^^^^^^^^^
This is zero. Maybe intentional? If so just send a reply to this email
and I won't bother you again.
614 cs35l34->mclk_int = freq;
615 break;
616 case CS35L34_MCLK_6:
617 value = ~CS35L34_MCLK_DIV & CS35L34_MCLK_RATE_6P0000;
618 cs35l34->mclk_int = freq;
619 break;
620 case CS35L34_MCLK_6144:
621 value = ~CS35L34_MCLK_DIV & CS35L34_MCLK_RATE_6P1440;
622 cs35l34->mclk_int = freq;
623 break;
624 case CS35L34_MCLK_11289:
625 value = CS35L34_MCLK_DIV | CS35L34_MCLK_RATE_5P6448;
626 cs35l34->mclk_int = freq / 2;
627 break;
628 case CS35L34_MCLK_12:
629 value = CS35L34_MCLK_DIV | CS35L34_MCLK_RATE_6P0000;
630 cs35l34->mclk_int = freq / 2;
631 break;
632 case CS35L34_MCLK_12288:
633 value = CS35L34_MCLK_DIV | CS35L34_MCLK_RATE_6P1440;
634 cs35l34->mclk_int = freq / 2;
635 break;
636 default:
637 dev_err(codec->dev, "ERROR: Invalid Frequency %d\n", freq);
638 cs35l34->mclk_int = 0;
639 return -EINVAL;
640 }
641 regmap_update_bits(cs35l34->regmap, CS35L34_MCLK_CTL,
642 CS35L34_MCLK_DIV | CS35L34_MCLK_RATE_MASK, value);
643 return 0;
644 }
regards,
dan carpenter
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [bug report] ASoC: cs35l34: Initial commit of the cs35l34 CODEC driver.
2016-11-10 12:54 [bug report] ASoC: cs35l34: Initial commit of the cs35l34 CODEC driver Dan Carpenter
@ 2016-11-10 15:21 ` Handrigan, Paul
2016-11-10 16:46 ` Lars-Peter Clausen
0 siblings, 1 reply; 3+ messages in thread
From: Handrigan, Paul @ 2016-11-10 15:21 UTC (permalink / raw)
To: Dan Carpenter; +Cc: alsa-devel
On 11/10/16, 6:54 AM, "Dan Carpenter" <dan.carpenter@oracle.com> wrote:
>Hello Paul Handrigan,
>
>The patch c1124c09e103: "ASoC: cs35l34: Initial commit of the cs35l34
>CODEC driver." from Oct 12, 2016, leads to the following static
>checker warning:
>
> sound/soc/codecs/cs35l34.c:613 cs35l34_dai_set_sysclk()
> warn: odd binop '0xffffffffffffffef & 0x0'
>
>sound/soc/codecs/cs35l34.c
> 604 static int cs35l34_dai_set_sysclk(struct snd_soc_dai *dai,
> 605 int clk_id, unsigned int freq,
>int dir)
> 606 {
> 607 struct snd_soc_codec *codec = dai->codec;
> 608 struct cs35l34_private *cs35l34 =
>snd_soc_codec_get_drvdata(codec);
> 609 unsigned int value;
> 610
> 611 switch (freq) {
> 612 case CS35L34_MCLK_5644:
> 613 value = ~CS35L34_MCLK_DIV &
>CS35L34_MCLK_RATE_5P6448;
>
>^^^^^^^^^^^^^^^^^^^^^^^^
>This is zero. Maybe intentional? If so just send a reply to this email
>and I won't bother you again.
This is ok.
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [bug report] ASoC: cs35l34: Initial commit of the cs35l34 CODEC driver.
2016-11-10 15:21 ` Handrigan, Paul
@ 2016-11-10 16:46 ` Lars-Peter Clausen
0 siblings, 0 replies; 3+ messages in thread
From: Lars-Peter Clausen @ 2016-11-10 16:46 UTC (permalink / raw)
To: Handrigan, Paul, Dan Carpenter; +Cc: alsa-devel
On 11/10/2016 04:21 PM, Handrigan, Paul wrote:
>
>
> On 11/10/16, 6:54 AM, "Dan Carpenter" <dan.carpenter@oracle.com> wrote:
>
>> Hello Paul Handrigan,
>>
>> The patch c1124c09e103: "ASoC: cs35l34: Initial commit of the cs35l34
>> CODEC driver." from Oct 12, 2016, leads to the following static
>> checker warning:
>>
>> sound/soc/codecs/cs35l34.c:613 cs35l34_dai_set_sysclk()
>> warn: odd binop '0xffffffffffffffef & 0x0'
>>
>> sound/soc/codecs/cs35l34.c
>> 604 static int cs35l34_dai_set_sysclk(struct snd_soc_dai *dai,
>> 605 int clk_id, unsigned int freq,
>> int dir)
>> 606 {
>> 607 struct snd_soc_codec *codec = dai->codec;
>> 608 struct cs35l34_private *cs35l34 =
>> snd_soc_codec_get_drvdata(codec);
>> 609 unsigned int value;
>> 610
>> 611 switch (freq) {
>> 612 case CS35L34_MCLK_5644:
>> 613 value = ~CS35L34_MCLK_DIV &
>> CS35L34_MCLK_RATE_5P6448;
>>
>> ^^^^^^^^^^^^^^^^^^^^^^^^
>> This is zero. Maybe intentional? If so just send a reply to this email
>> and I won't bother you again.
> This is ok.
It is still a slightly unusual way to write this. And I can see why it'd
confuse both humans as well as static checkers. Usually if you don't want to
set a bit in a bitmask you just leave it out.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-11-10 16:46 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-10 12:54 [bug report] ASoC: cs35l34: Initial commit of the cs35l34 CODEC driver Dan Carpenter
2016-11-10 15:21 ` Handrigan, Paul
2016-11-10 16:46 ` Lars-Peter Clausen
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.