From: Matti Vaittinen <mazziesaccount@gmail.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: "Matti Vaittinen" <matti.vaittinen@fi.rohmeurope.com>,
"Daniel Scally" <djrscally@gmail.com>,
"Heikki Krogerus" <heikki.krogerus@linux.intel.com>,
"Sakari Ailus" <sakari.ailus@linux.intel.com>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
"Lars-Peter Clausen" <lars@metafoo.de>,
"Michael Hennerich" <Michael.Hennerich@analog.com>,
"Jonathan Cameron" <jic23@kernel.org>,
"Andreas Klinger" <ak@it-klinger.de>,
"Marcin Wojtas" <mw@semihalf.com>,
"Russell King" <linux@armlinux.org.uk>,
"David S. Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@google.com>,
"Jakub Kicinski" <kuba@kernel.org>,
"Paolo Abeni" <pabeni@redhat.com>,
"Jonathan Neuschäfer" <j.neuschaefer@gmx.net>,
"Linus Walleij" <linus.walleij@linaro.org>,
"Paul Cercueil" <paul@crapouillou.net>,
"Wolfram Sang" <wsa@kernel.org>,
"Akhil R" <akhilrajeev@nvidia.com>,
linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-iio@vger.kernel.org, netdev@vger.kernel.org,
openbmc@lists.ozlabs.org, linux-gpio@vger.kernel.org,
linux-mips@vger.kernel.org
Subject: Re: [PATCH v4 2/7] iio: mb1232: relax return value check for IRQ get
Date: Fri, 19 May 2023 08:26:00 +0300 [thread overview]
Message-ID: <6ab1852e-139f-579b-3ef4-5c98e0ea446d@gmail.com> (raw)
In-Reply-To: <1a3a84d4-1955-f0ee-5c6d-ab36fddc5e15@gmail.com>
On 5/19/23 08:00, Matti Vaittinen wrote:
> On 5/17/23 19:47, Andy Shevchenko wrote:
>> On Tue, May 16, 2023 at 10:12:41AM +0300, Matti Vaittinen wrote:
>>> fwnode_irq_get() was changed to not return 0 anymore.
>>>
>>> Drop check for return value 0.
>>
>> ...
>>
>>> - if (data->irqnr <= 0) {
>>> + if (data->irqnr < 0) {
>>> /* usage of interrupt is optional */
>>> data->irqnr = -1;
>>> } else {
>>
>>
>> After this change I'm not sure we need this branch at all, I mean that
>> -errn is
>> equal to -1 in the code (but needs to be checked for silly checks like
>> == -1).
>>
>> Hence
>>
>> Entire excerpt can be replaced with
>>
>> if (data->irqnr > 0) {
>>
>
> I agree. Furthermore, at a quick glance it seems the whole irqnr could
> be dropped from the private data, and the private data struct could
> probably be static. I'd send them as separate clean-ups though as those
> changes are not really related to this return-value series.
Please, ignore everything I wrote above, except that I agree to your
suggestion. I was writing utter nonsense. Sorry for the noise.
>
> Yours,
> -- Matti
>
--
Matti Vaittinen
Linux kernel developer at ROHM Semiconductors
Oulu Finland
~~ When things go utterly wrong vim users can always type :help! ~~
next prev parent reply other threads:[~2023-05-19 5:26 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-16 7:12 [PATCH v4 0/7] fix fwnode_irq_get[_byname()] returnvalue Matti Vaittinen
2023-05-16 7:12 ` [PATCH v4 1/7] drivers: fwnode: fix fwnode_irq_get[_byname]() Matti Vaittinen
2023-05-16 7:12 ` [PATCH v4 2/7] iio: mb1232: relax return value check for IRQ get Matti Vaittinen
2023-05-17 16:47 ` Andy Shevchenko
2023-05-19 5:00 ` Matti Vaittinen
2023-05-19 5:26 ` Matti Vaittinen [this message]
2023-05-16 7:12 ` [PATCH v4 3/7] net-next: " Matti Vaittinen
2023-05-16 7:13 ` [PATCH v4 4/7] pinctrl: wpcm450: elax " Matti Vaittinen
2023-05-16 16:32 ` Jonathan Neuschäfer
2023-05-17 5:41 ` Vaittinen, Matti
2023-05-17 17:03 ` Andy Shevchenko
2023-05-16 7:13 ` [PATCH v4 5/7] pinctrl: ingenic: relax " Matti Vaittinen
2023-05-16 7:49 ` Paul Cercueil
2023-05-16 7:13 ` [PATCH v4 6/7] pinctrl: pistachio: " Matti Vaittinen
2023-05-16 7:14 ` [PATCH v4 7/7] iio: cdc: ad7150: Functional change Matti Vaittinen
2023-05-17 12:43 ` [PATCH v4 0/7] fix fwnode_irq_get[_byname()] returnvalue Linus Walleij
2023-05-17 13:09 ` Matti Vaittinen
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=6ab1852e-139f-579b-3ef4-5c98e0ea446d@gmail.com \
--to=mazziesaccount@gmail.com \
--cc=Michael.Hennerich@analog.com \
--cc=ak@it-klinger.de \
--cc=akhilrajeev@nvidia.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=davem@davemloft.net \
--cc=djrscally@gmail.com \
--cc=edumazet@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=heikki.krogerus@linux.intel.com \
--cc=j.neuschaefer@gmx.net \
--cc=jic23@kernel.org \
--cc=kuba@kernel.org \
--cc=lars@metafoo.de \
--cc=linus.walleij@linaro.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=matti.vaittinen@fi.rohmeurope.com \
--cc=mw@semihalf.com \
--cc=netdev@vger.kernel.org \
--cc=openbmc@lists.ozlabs.org \
--cc=pabeni@redhat.com \
--cc=paul@crapouillou.net \
--cc=rafael@kernel.org \
--cc=sakari.ailus@linux.intel.com \
--cc=wsa@kernel.org \
/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