* [PATCH] ASoC: samsung: Minor simplification in i2s_set_fmt()
@ 2016-10-10 2:04 ` Tobias Jakobi
2016-10-10 9:05 ` Sylwester Nawrocki
2016-10-10 17:05 ` Krzysztof Kozlowski
0 siblings, 2 replies; 6+ messages in thread
From: Tobias Jakobi @ 2016-10-10 2:04 UTC (permalink / raw)
To: linux-samsung-soc; +Cc: krzk, s.nawrocki, Michael McConville, Tobias Jakobi
From: Michael McConville <mmcco@mykolab.com>
We can replace the if-statement with the simpler bit
toggle operation.
Changes in v2:
- add proper commit header and description
Signed-off-by: Michael McConville <mmcco@mykolab.com>
Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
---
sound/soc/samsung/i2s.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c
index 50635ee..1c484ac 100644
--- a/sound/soc/samsung/i2s.c
+++ b/sound/soc/samsung/i2s.c
@@ -627,10 +627,7 @@ static int i2s_set_fmt(struct snd_soc_dai *dai,
case SND_SOC_DAIFMT_NB_NF:
break;
case SND_SOC_DAIFMT_NB_IF:
- if (tmp & lrp_rlow)
- tmp &= ~lrp_rlow;
- else
- tmp |= lrp_rlow;
+ tmp ^= lrp_rlow;
break;
default:
dev_err(&i2s->pdev->dev, "Polarity not supported\n");
--
2.7.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] ASoC: samsung: Minor simplification in i2s_set_fmt()
2016-10-10 2:04 ` [PATCH] ASoC: samsung: Minor simplification in i2s_set_fmt() Tobias Jakobi
@ 2016-10-10 9:05 ` Sylwester Nawrocki
2016-10-10 9:06 ` Tobias Jakobi
2016-10-10 17:05 ` Krzysztof Kozlowski
1 sibling, 1 reply; 6+ messages in thread
From: Sylwester Nawrocki @ 2016-10-10 9:05 UTC (permalink / raw)
To: Tobias Jakobi; +Cc: linux-samsung-soc, krzk, Michael McConville
On 10/10/2016 04:04 AM, Tobias Jakobi wrote:
> From: Michael McConville <mmcco@mykolab.com>
>
> We can replace the if-statement with the simpler bit
> toggle operation.
> Changes in v2:
> - add proper commit header and description
Thanks for the patch. The above 2 lines should be moved past the
scissors "---" line below.
> Signed-off-by: Michael McConville <mmcco@mykolab.com>
> Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
> ---
> sound/soc/samsung/i2s.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c
> index 50635ee..1c484ac 100644
> --- a/sound/soc/samsung/i2s.c
> +++ b/sound/soc/samsung/i2s.c
> @@ -627,10 +627,7 @@ static int i2s_set_fmt(struct snd_soc_dai *dai,
> case SND_SOC_DAIFMT_NB_NF:
> break;
> case SND_SOC_DAIFMT_NB_IF:
> - if (tmp & lrp_rlow)
> - tmp &= ~lrp_rlow;
> - else
> - tmp |= lrp_rlow;
> + tmp ^= lrp_rlow;
> break;
> default:
> dev_err(&i2s->pdev->dev, "Polarity not supported\n");
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] ASoC: samsung: Minor simplification in i2s_set_fmt()
2016-10-10 9:05 ` Sylwester Nawrocki
@ 2016-10-10 9:06 ` Tobias Jakobi
2016-10-10 9:25 ` Sylwester Nawrocki
0 siblings, 1 reply; 6+ messages in thread
From: Tobias Jakobi @ 2016-10-10 9:06 UTC (permalink / raw)
To: Sylwester Nawrocki, Tobias Jakobi
Cc: linux-samsung-soc, krzk, Michael McConville
Hello,
Sylwester Nawrocki wrote:
> On 10/10/2016 04:04 AM, Tobias Jakobi wrote:
>> From: Michael McConville <mmcco@mykolab.com>
>>
>> We can replace the if-statement with the simpler bit
>> toggle operation.
>
>> Changes in v2:
>> - add proper commit header and description
>
> Thanks for the patch. The above 2 lines should be moved past the
> scissors "---" line below.
should I resend, or can this be fixed on merge?
- Tobias
>> Signed-off-by: Michael McConville <mmcco@mykolab.com>
>> Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
>
> Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
>
>> ---
>
>> sound/soc/samsung/i2s.c | 5 +----
>> 1 file changed, 1 insertion(+), 4 deletions(-)
>>
>> diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c
>> index 50635ee..1c484ac 100644
>> --- a/sound/soc/samsung/i2s.c
>> +++ b/sound/soc/samsung/i2s.c
>> @@ -627,10 +627,7 @@ static int i2s_set_fmt(struct snd_soc_dai *dai,
>> case SND_SOC_DAIFMT_NB_NF:
>> break;
>> case SND_SOC_DAIFMT_NB_IF:
>> - if (tmp & lrp_rlow)
>> - tmp &= ~lrp_rlow;
>> - else
>> - tmp |= lrp_rlow;
>> + tmp ^= lrp_rlow;
>> break;
>> default:
>> dev_err(&i2s->pdev->dev, "Polarity not supported\n");
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] ASoC: samsung: Minor simplification in i2s_set_fmt()
2016-10-10 9:06 ` Tobias Jakobi
@ 2016-10-10 9:25 ` Sylwester Nawrocki
0 siblings, 0 replies; 6+ messages in thread
From: Sylwester Nawrocki @ 2016-10-10 9:25 UTC (permalink / raw)
To: Tobias Jakobi; +Cc: linux-samsung-soc, krzk, Michael McConville
Hi,
On 10/10/2016 11:06 AM, Tobias Jakobi wrote:
> should I resend, or can this be fixed on merge?
I'm not sure, probably it's better to resend. But most importantly
please send it directly to Mark (broonie@kernel.org). Otherwise
it may not be guaranteed the patch gets applied. And please make
sure alsa-devel@alsa-project.org is copied.
--
Thanks,
Sylwester
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] ASoC: samsung: Minor simplification in i2s_set_fmt()
2016-10-10 2:04 ` [PATCH] ASoC: samsung: Minor simplification in i2s_set_fmt() Tobias Jakobi
2016-10-10 9:05 ` Sylwester Nawrocki
@ 2016-10-10 17:05 ` Krzysztof Kozlowski
2016-10-10 17:18 ` Tobias Jakobi
1 sibling, 1 reply; 6+ messages in thread
From: Krzysztof Kozlowski @ 2016-10-10 17:05 UTC (permalink / raw)
To: Tobias Jakobi; +Cc: linux-samsung-soc, krzk, s.nawrocki, Michael McConville
On Mon, Oct 10, 2016 at 04:04:05AM +0200, Tobias Jakobi wrote:
> From: Michael McConville <mmcco@mykolab.com>
>
> We can replace the if-statement with the simpler bit
> toggle operation.
>
> Changes in v2:
> - add proper commit header and description
>
> Signed-off-by: Michael McConville <mmcco@mykolab.com>
> Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
> ---
> sound/soc/samsung/i2s.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c
> index 50635ee..1c484ac 100644
> --- a/sound/soc/samsung/i2s.c
> +++ b/sound/soc/samsung/i2s.c
> @@ -627,10 +627,7 @@ static int i2s_set_fmt(struct snd_soc_dai *dai,
> case SND_SOC_DAIFMT_NB_NF:
> break;
> case SND_SOC_DAIFMT_NB_IF:
> - if (tmp & lrp_rlow)
> - tmp &= ~lrp_rlow;
> - else
> - tmp |= lrp_rlow;
> + tmp ^= lrp_rlow;
It is late, full day of work... so I might be thinking slowly... but
this does not look like proper replacement. Unless for specific values
used in the driver this works? From mathematical point of view, imagine
tmp=6 abd lrp_rlow=3.
This is not equal...
But... maybe it is late... :)
Krzysztof
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] ASoC: samsung: Minor simplification in i2s_set_fmt()
2016-10-10 17:05 ` Krzysztof Kozlowski
@ 2016-10-10 17:18 ` Tobias Jakobi
0 siblings, 0 replies; 6+ messages in thread
From: Tobias Jakobi @ 2016-10-10 17:18 UTC (permalink / raw)
To: Krzysztof Kozlowski; +Cc: linux-samsung-soc, s.nawrocki, Michael McConville
Hello Krzysztof,
Krzysztof Kozlowski wrote:
> On Mon, Oct 10, 2016 at 04:04:05AM +0200, Tobias Jakobi wrote:
>> From: Michael McConville <mmcco@mykolab.com>
>>
>> We can replace the if-statement with the simpler bit
>> toggle operation.
>>
>> Changes in v2:
>> - add proper commit header and description
>>
>> Signed-off-by: Michael McConville <mmcco@mykolab.com>
>> Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
>> ---
>> sound/soc/samsung/i2s.c | 5 +----
>> 1 file changed, 1 insertion(+), 4 deletions(-)
>>
>> diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c
>> index 50635ee..1c484ac 100644
>> --- a/sound/soc/samsung/i2s.c
>> +++ b/sound/soc/samsung/i2s.c
>> @@ -627,10 +627,7 @@ static int i2s_set_fmt(struct snd_soc_dai *dai,
>> case SND_SOC_DAIFMT_NB_NF:
>> break;
>> case SND_SOC_DAIFMT_NB_IF:
>> - if (tmp & lrp_rlow)
>> - tmp &= ~lrp_rlow;
>> - else
>> - tmp |= lrp_rlow;
>> + tmp ^= lrp_rlow;
>
> It is late, full day of work... so I might be thinking slowly... but
> this does not look like proper replacement. Unless for specific values
> used in the driver this works? From mathematical point of view, imagine
> tmp=6 abd lrp_rlow=3.
>
> This is not equal...
>
> But... maybe it is late... :)
No, you're correct, this obviously only works for lrp_rlow of the type
(1 << n). For arbitrary values this transformation isn't equivalent. But
it applies here.
Anyway, please drop this if you think it is misleading. I just found it
while cleaning my inbox.
- Tobias
>
> Krzysztof
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2016-10-10 17:20 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <CGME20161010020438eucas1p2f24f4419a03de8df4bbd1156d859e1d0@eucas1p2.samsung.com>
2016-10-10 2:04 ` [PATCH] ASoC: samsung: Minor simplification in i2s_set_fmt() Tobias Jakobi
2016-10-10 9:05 ` Sylwester Nawrocki
2016-10-10 9:06 ` Tobias Jakobi
2016-10-10 9:25 ` Sylwester Nawrocki
2016-10-10 17:05 ` Krzysztof Kozlowski
2016-10-10 17:18 ` Tobias Jakobi
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.