[PATCH v2 4/4] gpio: aspeed: Add interfaces for co-processor to grab GPIOs

Benjamin Herrenschmidt benh at kernel.crashing.org
Tue Jun 19 10:36:46 AEST 2018


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.


More information about the Linux-aspeed mailing list