Thread (17 messages) 17 messages, 6 authors, 2023-05-19

Re: [PATCH v4 2/7] iio: mb1232: relax return value check for IRQ get

From: Matti Vaittinen <mazziesaccount@gmail.com>
Date: 2023-05-19 05:26:12
Also in: linux-acpi, linux-gpio, linux-iio, linux-mips, lkml

On 5/19/23 08:00, Matti Vaittinen wrote:
On 5/17/23 19:47, Andy Shevchenko wrote:
quoted
On Tue, May 16, 2023 at 10:12:41AM +0300, Matti Vaittinen wrote:
quoted
fwnode_irq_get() was changed to not return 0 anymore.

Drop check for return value 0.
...
quoted
-    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! ~~
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help