Linux Samsung SOC development
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzk@kernel.org>
To: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Cc: linux-samsung-soc@vger.kernel.org, krzk@kernel.org,
	s.nawrocki@samsung.com, Michael McConville <mmcco@mykolab.com>
Subject: Re: [PATCH] ASoC: samsung: Minor simplification in i2s_set_fmt()
Date: Mon, 10 Oct 2016 20:05:28 +0300	[thread overview]
Message-ID: <20161010170528.GB3352@kozik-lap> (raw)
In-Reply-To: <1476065045-13865-1-git-send-email-tjakobi@math.uni-bielefeld.de>

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

  parent reply	other threads:[~2016-10-10 17:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [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 [this message]
2016-10-10 17:18     ` Tobias Jakobi

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=20161010170528.GB3352@kozik-lap \
    --to=krzk@kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=mmcco@mykolab.com \
    --cc=s.nawrocki@samsung.com \
    --cc=tjakobi@math.uni-bielefeld.de \
    /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