[PATCH v4 02/11] gpio: pxa: clean code with same variable name

Igor Grinberg grinberg at compulab.co.il
Wed Feb 20 03:13:54 EST 2013


On 02/19/13 18:22, Haojian Zhuang wrote:
> Clean code to avoid similar variable. Now use gc for gpio_chip,
> and use c/chip for pxa_gpio_chip. It's used to avoid confusion.
> 
> Signed-off-by: Haojian Zhuang <haojian.zhuang at linaro.org>

Tested-by: Igor Grinberg <grinberg at compulab.co.il>

Minor issue below for your consideration.

> ---
>  drivers/gpio/gpio-pxa.c |  102 +++++++++++++++++++++++------------------------
>  1 file changed, 50 insertions(+), 52 deletions(-)
> 
> diff --git a/drivers/gpio/gpio-pxa.c b/drivers/gpio/gpio-pxa.c
> index a4c6687..e611bed 100644
> --- a/drivers/gpio/gpio-pxa.c
> +++ b/drivers/gpio/gpio-pxa.c

[...]

> @@ -147,7 +147,7 @@ static inline int __gpio_is_occupied(unsigned gpio)
>  	int ret, af = 0, dir = 0;
>  
>  	pxachip = gpio_to_pxachip(gpio);
> -	base = gpio_chip_base(&pxachip->chip);
> +	base = gpio_chip_base(&pxachip->gc);

I don't mind leaving this as it is, but according
to your commit message, the above should be:
c/chip = gpio_to_pxachip(gpio);
base = gpio_chip_base(&c/chip->gc);

For your consideration.

>  	gpdr = readl_relaxed(base + GPDR_OFFSET);
>  
>  	switch (gpio_type) {

[...]


-- 
Regards,
Igor.



More information about the linux-arm-kernel mailing list