linux-aspeed.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: linux-aspeed@lists.ozlabs.org
Subject: [PATCH v2 4/4] gpio: aspeed: Add interfaces for co-processor to grab GPIOs
Date: Tue, 19 Jun 2018 10:36:46 +1000	[thread overview]
Message-ID: <f0cf23fe554f2ab75ab07b164cfc6abc3b08fcfc.camel@kernel.crashing.org> (raw)
In-Reply-To: <f330ef1074ba7a22ff06cc0dbcddd7455f238905.camel@kernel.crashing.org>

On Tue, 2018-06-19 at 00:38 +1000, Benjamin Herrenschmidt wrote:
> On Mon, 2018-06-18 at 23:53 +0930, Andrew Jeffery wrote:
> > 
> > >   static inline int irqd_to_aspeed_gpio_data(struct irq_data *d,
> > > -           struct aspeed_gpio **gpio,
> > > -           const struct aspeed_gpio_bank **bank,
> > > -           u32 *bit)
> > > +                                      struct aspeed_gpio **gpio,
> > > +                                      const struct aspeed_gpio_bank **bank,
> > > +                                      u32 *bit, int *offset)
> > >   {
> > > -   int offset;
> > >      struct aspeed_gpio *internal;
> > >   
> > > -   offset = irqd_to_hwirq(d);
> > > +   *offset = irqd_to_hwirq(d);
> > 
> > Nit: Did you intend to set this out parameter before potentially returning an error? I had tried to avoid that up until now.
> 
> Yeah it's constant-ish, I don't see why not

I mean it's a pure function of the input, it's not like there's any
special side effect that one may want to avoid in case of error.

Cheers,
Ben.

  reply	other threads:[~2018-06-19  0:36 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-18  4:53 [PATCH v2 0/4] gpio: aspeed: Fixes and support for sharing with co-processor Benjamin Herrenschmidt
2018-06-18  4:53 ` [PATCH v2 1/4] gpio: aspeed: Rework register type accessors Benjamin Herrenschmidt
2018-06-18  5:38   ` Joel Stanley
2018-06-18  5:55   ` Andrew Jeffery
2018-06-18  4:53 ` [PATCH v2 2/4] gpio: aspeed: Add "Read Data" register to read the write latch Benjamin Herrenschmidt
2018-06-18  5:38   ` Joel Stanley
2018-06-18 13:38   ` Andrew Jeffery
2018-06-18 13:49     ` Benjamin Herrenschmidt
2018-06-18  4:53 ` [PATCH v2 3/4] gpio: aspeed: Add command source registers Benjamin Herrenschmidt
2018-06-18  5:38   ` Joel Stanley
2018-06-18  6:14   ` Andrew Jeffery
2018-06-18  4:53 ` [PATCH v2 4/4] gpio: aspeed: Add interfaces for co-processor to grab GPIOs Benjamin Herrenschmidt
2018-06-18  5:38   ` Joel Stanley
2018-06-18 14:23   ` Andrew Jeffery
2018-06-18 14:38     ` Benjamin Herrenschmidt
2018-06-19  0:36       ` Benjamin Herrenschmidt [this message]
2018-06-19  0:38         ` Andrew Jeffery

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=f0cf23fe554f2ab75ab07b164cfc6abc3b08fcfc.camel@kernel.crashing.org \
    --to=benh@kernel.crashing.org \
    --cc=linux-aspeed@lists.ozlabs.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;
as well as URLs for NNTP newsgroup(s).