linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jean Delvare <jdelvare@suse.de>
To: Daniel Kurtz <djkurtz@chromium.org>
Cc: Linux I2C <linux-i2c@vger.kernel.org>,
	Jarkko Nikula <jarkko.nikula@linux.intel.com>,
	Mika Westerberg <mika.westerberg@linux.intel.com>,
	Wolfram Sang <wsa@the-dreams.de>
Subject: Re: [PATCH] i2c: i801: Drop needless bit-wise OR
Date: Wed, 1 Jun 2016 11:37:03 +0200	[thread overview]
Message-ID: <20160601113703.382c2a5f@endymion> (raw)
In-Reply-To: <CAGS+omBnhpUYTXzooaZZgMChyepiAkSzt0-MxRe530=-bTyCsw@mail.gmail.com>

Hi Daniel,

On Mon, 30 May 2016 22:07:55 +0800, Daniel Kurtz wrote:
> On Wed, May 25, 2016 at 3:37 PM, Jean Delvare <jdelvare@suse.de> wrote:
> > The interrupt handling code makes it look like several status values
> > may be merged together before being processed, while this will never
> > happen. Change from bit-wise OR to simple assignment to make it more
> > obvious and avoid misunderstanding.
> >
> > Signed-off-by: Jean Delvare <jdelvare@suse.de>
> > Cc: Daniel Kurtz <djkurtz@chromium.org>
> > Cc: Jarkko Nikula <jarkko.nikula@linux.intel.com>
> > Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
> > Cc: Wolfram Sang <wsa@the-dreams.de>
> > ---
> > Daniel, was there any reason for this bit-wise OR, which I may be
> > missing?
> 
> The only thing I can think of is that I didn't want to assume that we
> would always clear priv->status before another interrupt arrived.

Well my question is quite clear: can this actually happen? I can't see
how.

> >  drivers/i2c/busses/i2c-i801.c |    2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > --- linux-4.5.orig/drivers/i2c/busses/i2c-i801.c        2016-05-24 11:04:33.169026906 +0200
> > +++ linux-4.5/drivers/i2c/busses/i2c-i801.c     2016-05-24 11:05:40.564642488 +0200
> > @@ -548,7 +548,7 @@ static irqreturn_t i801_isr(int irq, voi
> >         status &= SMBHSTSTS_INTR | STATUS_ERROR_FLAGS;
> >         if (status) {
> >                 outb_p(status, SMBHSTSTS(priv));
> > -               priv->status |= status;
> > +               priv->status = status;
> >                 wake_up(&priv->waitq);
> >         }

-- 
Jean Delvare
SUSE L3 Support

  reply	other threads:[~2016-06-01  9:37 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-25  7:37 [PATCH] i2c: i801: Drop needless bit-wise OR Jean Delvare
2016-05-26  8:36 ` Mika Westerberg
2016-05-30 14:07 ` Daniel Kurtz
2016-06-01  9:37   ` Jean Delvare [this message]
2016-06-01  9:38     ` Daniel Kurtz
2016-06-02 11:45       ` Jean Delvare
2016-06-03 11:21         ` Daniel Kurtz
2016-06-08 16:30 ` Benjamin Tissoires
2016-06-09 20:28 ` [PATCH] " Wolfram Sang

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=20160601113703.382c2a5f@endymion \
    --to=jdelvare@suse.de \
    --cc=djkurtz@chromium.org \
    --cc=jarkko.nikula@linux.intel.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    --cc=wsa@the-dreams.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;
as well as URLs for NNTP newsgroup(s).