Re: [PATCH v2 2/7] gpiolib: Make use of enum gpio_lookup_flags consistent

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Apr 11, 2019 at 11:57:13AM +0300, Mika Westerberg wrote:
> On Wed, Apr 10, 2019 at 06:39:16PM +0300, Andy Shevchenko wrote:
> > The library uses enum gpio_lookup_flags to define the possible
> > characteristics of GPIO pin. Since enumerator listed only individual
> > bits the common use of it is in a form of a bitmask of
> > gpio_lookup_flags GPIO_* values. The more correct type for this is
> > unsigned long.
> > 
> > Due to above convert all users to use unsigned long instead of
> > enum gpio_lookup_flags except enumerator definition.
> > 
> > While here, make field and parameter descriptions consistent as well.
> > 
> > Suggested-by: Mika Westerberg <mika.westerberg@xxxxxxxxxxxxxxx>
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
> 
> One small comment:
> 
> > ---
> >  drivers/gpio/gpiolib-acpi.c  | 14 +++++++++-----
> >  drivers/gpio/gpiolib-of.c    | 11 +++++------
> >  drivers/gpio/gpiolib.c       | 13 ++++++-------
> >  drivers/gpio/gpiolib.h       |  9 ++++-----
> >  include/linux/gpio/machine.h |  8 ++++----
> >  5 files changed, 28 insertions(+), 27 deletions(-)
> > 
> > diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c
> > index 30d0baf7ddae..ba9cafa13ca2 100644
> > --- a/drivers/gpio/gpiolib-acpi.c
> > +++ b/drivers/gpio/gpiolib-acpi.c
> > @@ -696,7 +696,7 @@ struct gpio_desc *acpi_find_gpio(struct device *dev,
> >  				 const char *con_id,
> >  				 unsigned int idx,
> >  				 enum gpiod_flags *dflags,
> > -				 enum gpio_lookup_flags *lookupflags)
> > +				 unsigned long *lookupflags)
> >  {
> >  	struct acpi_device *adev = ACPI_COMPANION(dev);
> >  	struct acpi_gpio_info info;
> > @@ -992,9 +992,12 @@ static void acpi_gpiochip_free_regions(struct acpi_gpio_chip *achip)
> >  	}
> >  }
> >  
> > -static struct gpio_desc *acpi_gpiochip_parse_own_gpio(
> > -	struct acpi_gpio_chip *achip, struct fwnode_handle *fwnode,
> > -	const char **name, unsigned int *lflags, unsigned int *dflags)
> > +static struct gpio_desc *
> > +acpi_gpiochip_parse_own_gpio(struct acpi_gpio_chip *achip,
> > +			     struct fwnode_handle *fwnode,
> > +			     const char **name,
> > +			     unsigned long *lflags,
> > +			     unsigned int *dflags)
> 
> Why not "unsigned int"? Now it looks inconsistent.

inconsistent with what part?

-- 
With Best Regards,
Andy Shevchenko





[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux