All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Serge Semin <fancer.lancer@gmail.com>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	Bartosz Golaszewski <bgolaszewski@baylibre.com>,
	linux-gpio@vger.kernel.org
Subject: Re: [PATCH v1 4/4] gpio: dwapb: Remove unneeded has_irq member in struct dwapb_port_property
Date: Mon, 18 May 2020 20:27:24 +0300	[thread overview]
Message-ID: <20200518172724.GP1634618@smile.fi.intel.com> (raw)
In-Reply-To: <20200517142630.wqgzspmcnfmi6lzm@mobilestation>

On Sun, May 17, 2020 at 05:26:30PM +0300, Serge Semin wrote:
> On Tue, May 12, 2020 at 09:45:13PM +0300, Andy Shevchenko wrote:
> > has_irq member of struct dwapb_port_property is used only in one place,
> > so, make it local test instead and remove from the structure.

...

> > +	if (memchr_inv(pp->irq, 0, sizeof(pp->irq)) == NULL) {
> > +		dev_warn(gpio->dev, "no IRQ for port%d\n", pp->idx);
> > +		return;
> > +	}
> > +
> 
> Ah, that's why you added the memchr_inv() method in patch 2. So to move it
> to dwapb_configure_irqs() at this point.

Yes.

> Anyway I still think, that it would be
> better to leave the has_irq initialization in the loop there, but here you could
> just remove that assignment.

I think you noticed that I don't like to ping-pong in the series, for what you
propose it would be something like

original --->>>

	if (pp->irq[j] >= 0)
		pp->has_irq = true;

after patch 2 (if your suggestion applied) --->>>

	if (irq > 0) {
		pp->irq[j] = irq;
		pp->has->irq = true;
	}

after this patch --->>>

	if (irq > 0)
		pp->irq[j] = irq;

I prefer not to do this.

OTOH, I guess it might work if we leave original conditional separate to
assignment of IRQ itself (with '>= 0' -> '> 0' being replaced).

I'll look what can I do here.

> For this patch:
> 
> Reviewed-by: Serge Semin <fancer.lancer@gmail.com>

Thank you!

> I'll test the whole series up when you send v2. Our hardware is equipped with
> two DW APB GPIO IPs with Port A enabled for each. One of them is connected to an
> interrupt controller by a single line.

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2020-05-18 17:27 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-12 18:45 [PATCH v1 1/4] gpio: dwapb: avoid error message for optional IRQ Andy Shevchenko
2020-05-12 18:45 ` [PATCH v1 2/4] gpio: dwapb: Don't use 0 as valid Linux interrupt number Andy Shevchenko
2020-05-17 12:52   ` Serge Semin
2020-05-18 16:12     ` Andy Shevchenko
2020-05-12 18:45 ` [PATCH v1 3/4] gpio: dwapb: Drop extra check to call acpi_gpiochip_request_interrupts() Andy Shevchenko
2020-05-17 13:55   ` Serge Semin
2020-05-17 14:47     ` Serge Semin
2020-05-18 17:03       ` Andy Shevchenko
2020-05-18 17:07     ` Andy Shevchenko
2020-05-12 18:45 ` [PATCH v1 4/4] gpio: dwapb: Remove unneeded has_irq member in struct dwapb_port_property Andy Shevchenko
2020-05-12 22:53   ` kbuild test robot
2020-05-12 22:53     ` kbuild test robot
2020-05-13 10:22     ` Andy Shevchenko
2020-05-13 10:22       ` Andy Shevchenko
2020-05-13 12:39   ` kbuild test robot
2020-05-13 12:39     ` kbuild test robot
2020-05-17 14:26   ` Serge Semin
2020-05-18 17:27     ` Andy Shevchenko [this message]
2020-05-13 14:43 ` [PATCH v1 1/4] gpio: dwapb: avoid error message for optional IRQ Andy Shevchenko
2020-05-14 11:59   ` Serge Semin
2020-05-17 12:22 ` Serge Semin
2020-05-13  0:43 [PATCH v1 4/4] gpio: dwapb: Remove unneeded has_irq member in struct dwapb_port_property kbuild test robot

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=20200518172724.GP1634618@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=bgolaszewski@baylibre.com \
    --cc=fancer.lancer@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.