[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAHp75VeVJHt+jja614VN2eqJeaH=kP-qw5kTbLgDsg05_CWT3A@mail.gmail.com>
Date: Tue, 30 Mar 2021 13:22:45 +0300
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Álvaro Fernández Rojas <noltari@...il.com>
Cc: Stephen Rothwell <sfr@...b.auug.org.au>,
Linus Walleij <linus.walleij@...aro.org>,
Jonas Gorski <jonas.gorski@...il.com>,
"open list:GPIO SUBSYSTEM" <linux-gpio@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] pinctrl: bcm: bcm6362: fix warning
On Tue, Mar 30, 2021 at 11:34 AM Álvaro Fernández Rojas
<noltari@...il.com> wrote:
>
> The current implementation of bcm6362_set_gpio() produces the following
> warning on x86_64:
> drivers/pinctrl/bcm/pinctrl-bcm6362.c: In function 'bcm6362_set_gpio':
> drivers/pinctrl/bcm/pinctrl-bcm6362.c:503:8: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
> 503 | (uint32_t) desc->drv_data, 0);
> | ^
>
> Modify the code to make it similar to bcm63268_set_gpio() in order to fix the
> warning.
>
> Fixes: 705791e23ecd ("pinctrl: add a pincontrol driver for BCM6362")
> Signed-off-by: Álvaro Fernández Rojas <noltari@...il.com>
> ---
> drivers/pinctrl/bcm/pinctrl-bcm6362.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/pinctrl/bcm/pinctrl-bcm6362.c b/drivers/pinctrl/bcm/pinctrl-bcm6362.c
> index eb7ec80353e9..6b5a1dfc2367 100644
> --- a/drivers/pinctrl/bcm/pinctrl-bcm6362.c
> +++ b/drivers/pinctrl/bcm/pinctrl-bcm6362.c
> @@ -496,11 +496,12 @@ static int bcm6362_pinctrl_get_groups(struct pinctrl_dev *pctldev,
> static void bcm6362_set_gpio(struct bcm63xx_pinctrl *pc, unsigned pin)
> {
> const struct pinctrl_pin_desc *desc = &bcm6362_pins[pin];
> + unsigned int basemode = (unsigned long) desc->drv_data;
Space between ) and d is not needed.
Usually we use uintptr_t for casting pointers to the integers.
> unsigned int mask = bcm63xx_bank_pin(pin);
>
> - if (desc->drv_data)
> - regmap_update_bits(pc->regs, BCM6362_BASEMODE_REG,
> - (uint32_t) desc->drv_data, 0);
> + if (basemode)
> + regmap_update_bits(pc->regs, BCM6362_BASEMODE_REG, basemode,
> + 0);
Put it on one line for sake of the readability.
>
> if (pin < BCM63XX_BANK_GPIOS) {
> /* base mode 0 => gpio 1 => mux function */
> --
> 2.20.1
>
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists