linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH]  ASoC : fsl_ssi : Correct the condition to check AC97 mode
@ 2016-12-28 11:06 Harisangam, Sharvari (S.)
  2016-12-28 14:50 ` Andreas Schwab
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Harisangam, Sharvari (S.) @ 2016-12-28 11:06 UTC (permalink / raw)
  To: Timur Tabi, Nicolin Chen, Xiubo Li, Liam Girdwood, Mark Brown,
	Jaroslav Kysela, Takashi Iwai
  Cc: alsa-devel, linuxppc-dev, linux-kernel

 Corrected the condition to check if ssi is configured for AC97
 mode. Other modes like dsp_a also satisfy the ANDing condition.

Signed-off-by: Sharvari Harisangam <sharvari.harisangam@visteon.com>
---
 sound/soc/fsl/fsl_ssi.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c
index ca6f6b1..4fbb7a2 100644
--- a/sound/soc/fsl/fsl_ssi.c
+++ b/sound/soc/fsl/fsl_ssi.c
@@ -317,7 +317,8 @@ MODULE_DEVICE_TABLE(of, fsl_ssi_ids);
 
 static bool fsl_ssi_is_ac97(struct fsl_ssi_private *ssi_private)
 {
-	return !!(ssi_private->dai_fmt & SND_SOC_DAIFMT_AC97);
+	return !!(ssi_private->dai_fmt & SND_SOC_DAIFMT_AC97) ==
+		SND_SOC_DAIFMT_AC97;
 }
 
 static bool fsl_ssi_is_i2s_master(struct fsl_ssi_private *ssi_private)
@@ -1016,7 +1017,7 @@ static int _fsl_ssi_set_dai_fmt(struct device *dev,
 				CCSR_SSI_SCR_TCH_EN);
 	}
 
-	if (fmt & SND_SOC_DAIFMT_AC97)
+	if ((fmt & SND_SOC_DAIFMT_AC97) == SND_SOC_DAIFMT_AC97)
 		fsl_ssi_setup_ac97(ssi_private);
 
 	return 0;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH]  ASoC : fsl_ssi : Correct the condition to check AC97 mode
  2016-12-28 11:06 [PATCH] ASoC : fsl_ssi : Correct the condition to check AC97 mode Harisangam, Sharvari (S.)
@ 2016-12-28 14:50 ` Andreas Schwab
  2016-12-28 15:48   ` Timur Tabi
                     ` (2 more replies)
  2016-12-28 17:53 ` [alsa-devel] " Fabio Estevam
  2017-01-04 12:22 ` David Laight
  2 siblings, 3 replies; 7+ messages in thread
From: Andreas Schwab @ 2016-12-28 14:50 UTC (permalink / raw)
  To: Harisangam, Sharvari (S.)
  Cc: Timur Tabi, Nicolin Chen, Xiubo Li, Liam Girdwood, Mark Brown,
	Jaroslav Kysela, Takashi Iwai, alsa-devel, linuxppc-dev,
	linux-kernel

On Dez 28 2016, "Harisangam, Sharvari (S.)" <sharvari.harisangam@visteon.com> wrote:

> +	return !!(ssi_private->dai_fmt & SND_SOC_DAIFMT_AC97) ==
> +		SND_SOC_DAIFMT_AC97;

This is never true.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] ASoC : fsl_ssi : Correct the condition to check AC97 mode
  2016-12-28 14:50 ` Andreas Schwab
@ 2016-12-28 15:48   ` Timur Tabi
  2016-12-28 15:53   ` Harisangam, Sharvari (S.)
       [not found]   ` <9ebb798c-6040-9262-9625-ddcebd05a188__32955.7460187518$1482940206$gmane$org@tabi.org>
  2 siblings, 0 replies; 7+ messages in thread
From: Timur Tabi @ 2016-12-28 15:48 UTC (permalink / raw)
  To: Andreas Schwab, Harisangam, Sharvari (S.)
  Cc: Nicolin Chen, Xiubo Li, Liam Girdwood, Mark Brown,
	Jaroslav Kysela, Takashi Iwai, alsa-devel, linuxppc-dev,
	linux-kernel

Andreas Schwab wrote:
>> > +	return !!(ssi_private->dai_fmt & SND_SOC_DAIFMT_AC97) ==
>> > +		SND_SOC_DAIFMT_AC97;
> This is never true.

I think the right parenthesis should be at the end of the expression.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH]  ASoC : fsl_ssi : Correct the condition to check AC97 mode
  2016-12-28 14:50 ` Andreas Schwab
  2016-12-28 15:48   ` Timur Tabi
@ 2016-12-28 15:53   ` Harisangam, Sharvari (S.)
       [not found]   ` <9ebb798c-6040-9262-9625-ddcebd05a188__32955.7460187518$1482940206$gmane$org@tabi.org>
  2 siblings, 0 replies; 7+ messages in thread
From: Harisangam, Sharvari (S.) @ 2016-12-28 15:53 UTC (permalink / raw)
  To: Andreas Schwab
  Cc: Timur Tabi, Nicolin Chen, Xiubo Li, Liam Girdwood, Mark Brown,
	Jaroslav Kysela, Takashi Iwai, alsa-devel, linuxppc-dev,
	linux-kernel

On Wed, Dec 28, 2016 at 03:50:57PM +0100, Andreas Schwab wrote:
> On Dez 28 2016, "Harisangam, Sharvari (S.)" <sharvari.harisangam@visteon.com> wrote:
> 
> > +	return !!(ssi_private->dai_fmt & SND_SOC_DAIFMT_AC97) ==
> > +		SND_SOC_DAIFMT_AC97;
> 
> This is never true.
> 
> Andreas.
> 
> -- 
> Andreas Schwab, schwab@linux-m68k.org
> GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
> "And now for something completely different."

Ok. I missed the braces there. I will modify and resubmit the patch

-Thanks
Sharvari

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] ASoC : fsl_ssi : Correct the condition to check AC97 mode
       [not found]   ` <9ebb798c-6040-9262-9625-ddcebd05a188__32955.7460187518$1482940206$gmane$org@tabi.org>
@ 2016-12-28 16:52     ` Andreas Schwab
  0 siblings, 0 replies; 7+ messages in thread
From: Andreas Schwab @ 2016-12-28 16:52 UTC (permalink / raw)
  To: Timur Tabi
  Cc: Harisangam, Sharvari (S.),
	alsa-devel, Xiubo Li, Takashi Iwai, linux-kernel, Liam Girdwood,
	Jaroslav Kysela, Nicolin Chen, Mark Brown, linuxppc-dev

On Dez 28 2016, Timur Tabi <timur@tabi.org> wrote:

> Andreas Schwab wrote:
>>> > +	return !!(ssi_private->dai_fmt & SND_SOC_DAIFMT_AC97) ==
>>> > +		SND_SOC_DAIFMT_AC97;
>> This is never true.
>
> I think the right parenthesis should be at the end of the expression.

That would still test the wrong bitfield.

And all that is obsolete anyway since commit 5b64c173cd (of Sep 2015).

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [alsa-devel] [PATCH] ASoC : fsl_ssi : Correct the condition to check AC97 mode
  2016-12-28 11:06 [PATCH] ASoC : fsl_ssi : Correct the condition to check AC97 mode Harisangam, Sharvari (S.)
  2016-12-28 14:50 ` Andreas Schwab
@ 2016-12-28 17:53 ` Fabio Estevam
  2017-01-04 12:22 ` David Laight
  2 siblings, 0 replies; 7+ messages in thread
From: Fabio Estevam @ 2016-12-28 17:53 UTC (permalink / raw)
  To: Harisangam, Sharvari (S.)
  Cc: Timur Tabi, Nicolin Chen, Xiubo Li, Liam Girdwood, Mark Brown,
	Jaroslav Kysela, Takashi Iwai, alsa-devel, linuxppc-dev,
	linux-kernel

On Wed, Dec 28, 2016 at 9:06 AM, Harisangam, Sharvari (S.)
<sharvari.harisangam@visteon.com> wrote:
>  Corrected the condition to check if ssi is configured for AC97
>  mode. Other modes like dsp_a also satisfy the ANDing condition.
>
> Signed-off-by: Sharvari Harisangam <sharvari.harisangam@visteon.com>

This has been fixed in 4.3 kernel by commit:

5b64c173cdea211 ("ASoC: fsl_ssi: Fix checking of dai format for AC97 mode")

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [PATCH]  ASoC : fsl_ssi : Correct the condition to check AC97 mode
  2016-12-28 11:06 [PATCH] ASoC : fsl_ssi : Correct the condition to check AC97 mode Harisangam, Sharvari (S.)
  2016-12-28 14:50 ` Andreas Schwab
  2016-12-28 17:53 ` [alsa-devel] " Fabio Estevam
@ 2017-01-04 12:22 ` David Laight
  2 siblings, 0 replies; 7+ messages in thread
From: David Laight @ 2017-01-04 12:22 UTC (permalink / raw)
  To: 'Harisangam, Sharvari (S.)',
	Timur Tabi, Nicolin Chen, Xiubo Li, Liam Girdwood, Mark Brown,
	Jaroslav Kysela, Takashi Iwai
  Cc: alsa-devel, linuxppc-dev, linux-kernel

From: Harisangam, Sharvari (S.)
> Sent: 28 December 2016 11:07
>  Corrected the condition to check if ssi is configured for AC97
>  mode. Other modes like dsp_a also satisfy the ANDing condition.

Under the assumption that the constants have 1 bit set nothing is wrong.

	David

...
> -	return !!(ssi_private->dai_fmt & SND_SOC_DAIFMT_AC97);
...
> -	if (fmt & SND_SOC_DAIFMT_AC97)
...

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-01-04 12:22 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-28 11:06 [PATCH] ASoC : fsl_ssi : Correct the condition to check AC97 mode Harisangam, Sharvari (S.)
2016-12-28 14:50 ` Andreas Schwab
2016-12-28 15:48   ` Timur Tabi
2016-12-28 15:53   ` Harisangam, Sharvari (S.)
     [not found]   ` <9ebb798c-6040-9262-9625-ddcebd05a188__32955.7460187518$1482940206$gmane$org@tabi.org>
2016-12-28 16:52     ` Andreas Schwab
2016-12-28 17:53 ` [alsa-devel] " Fabio Estevam
2017-01-04 12:22 ` David Laight

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).