From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Peter Rosin <peda@axentia.se>
Cc: "linux-i2c@vger.kernel.org" <linux-i2c@vger.kernel.org>,
Wolfram Sang <wsa@the-dreams.de>
Subject: Re: [PATCH v1 1/5] i2c: mux: pca954x: Refactor pca954x_irq_handler()
Date: Fri, 6 Mar 2020 12:02:15 +0200 [thread overview]
Message-ID: <20200306100215.GS1224808@smile.fi.intel.com> (raw)
In-Reply-To: <31d8a07f-a841-d58b-ebc8-3cba39d00a95@axentia.se>
On Thu, Mar 05, 2020 at 09:34:46PM +0000, Peter Rosin wrote:
> On 2020-03-05 16:53, Andy Shevchenko wrote:
> > Refactor pca954x_irq_handler() to:
> > - use for_each_set_bit() macro
> > - use IRQ_RETVAL() macro
> >
> > Above change makes code easy to read and understand.
> > + pending = ret >> PCA954X_IRQ_OFFSET;
> > + for_each_set_bit(i, &pending, data->chip->nchans)
> > + handle_nested_irq(irq_linear_revmap(data->irq, i));
> > +
> > + return IRQ_RETVAL(pending);
>
> What if ret has some bit set above the bit corresponding to the last channel?
We will "handle" spurious interrupt.
> Maybe that's somehow not possible, but if that's the case it's not apparent.
So, does
pending = (ret >> PCA954X_IRQ_OFFSET) & (BIT(data->chip->nchans) - 1);
satisfy you?
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2020-03-06 10:02 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-05 15:53 [PATCH v1 1/5] i2c: mux: pca954x: Refactor pca954x_irq_handler() Andy Shevchenko
2020-03-05 15:53 ` [PATCH v1 2/5] i2c: mux: pca954x: Make use of device properties Andy Shevchenko
2020-03-05 21:05 ` Peter Rosin
2020-03-06 9:54 ` Andy Shevchenko
2020-03-06 11:48 ` Peter Rosin
2020-03-06 13:58 ` Andy Shevchenko
2020-03-06 14:57 ` Peter Rosin
2020-03-06 15:07 ` Andy Shevchenko
2020-03-05 15:53 ` [PATCH v1 3/5] i2c: mux: pca954x: Drop useless validation for optional GPIO descriptor Andy Shevchenko
2020-03-05 21:19 ` Peter Rosin
2020-03-06 9:56 ` Andy Shevchenko
2020-03-05 15:53 ` [PATCH v1 4/5] i2c: mux: pca954x: Move device_remove_file() out of pca954x_cleanup() Andy Shevchenko
2020-03-05 15:53 ` [PATCH v1 5/5] i2c: mux: pca954x: Convert license to SPDX identifier Andy Shevchenko
2020-03-05 21:34 ` [PATCH v1 1/5] i2c: mux: pca954x: Refactor pca954x_irq_handler() Peter Rosin
2020-03-06 10:02 ` Andy Shevchenko [this message]
2020-03-06 10:58 ` Peter Rosin
2020-03-16 16:08 ` Andy Shevchenko
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=20200306100215.GS1224808@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=linux-i2c@vger.kernel.org \
--cc=peda@axentia.se \
--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