linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthias Brugger <matthias.bgg@gmail.com>
To: Linus Walleij <linus.walleij@linaro.org>, linux-gpio@vger.kernel.org
Cc: Fabien Parent <fparent@baylibre.com>,
	Sean Wang <sean.wang@kernel.org>,
	Mattijs Korpershoek <mkorpershoek@baylibre.com>,
	linux-mediatek@lists.infradead.org,
	kernel test robot <lkp@intel.com>
Subject: Re: [PATCH] pinctrl: mediatek: move bit assignment
Date: Wed, 2 Jun 2021 14:34:27 +0200	[thread overview]
Message-ID: <b3d9f92d-a311-0093-4243-b21f2646997f@gmail.com> (raw)
In-Reply-To: <20210528091945.411471-1-linus.walleij@linaro.org>

Hi Linus,

On 28/05/2021 11:19, Linus Walleij wrote:
> The bit needs offset to be defined which happens some lines
> below. Looks like a bug. The kernel test robot complains:
> 
> drivers/pinctrl/mediatek/pinctrl-mtk-common.c:137:12:
> warning: variable 'offset' is uninitialized when used here [-Wuninitialized]
>            bit = BIT(offset & pctl->devdata->mode_mask);
>                      ^~~~~~
> 
> Fix it up by reverting to what was done before.
> 
> Cc: Fabien Parent <fparent@baylibre.com>
> Cc: Sean Wang <sean.wang@kernel.org>
> Cc: Matthias Brugger <matthias.bgg@gmail.com>
> Cc: Mattijs Korpershoek <mkorpershoek@baylibre.com>
> Cc: linux-mediatek@lists.infradead.org
> Fixes: 9f940d8ecf92 ("pinctrl: mediatek: don't hardcode mode encoding in common code")
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
>  drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
> index 9fe91e11a877..525b1aa7f7a6 100644
> --- a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
> +++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
> @@ -134,7 +134,7 @@ static int mtk_pconf_set_ies_smt(struct mtk_pinctrl *pctl, unsigned pin,
>  			pin, pctl->devdata->port_align, value, arg);
>  	}
>  
> -	
> +	bit = BIT(pin & 0xf);

I see this is already applied to linux-next, but I think the correct fix is to move
bit = BIT(offset & pctl->devdata->mode_mask);
just before calling regmap_write(...)

I can provide a patch for that, if you want. Just let me know if I should base
it against linux-next or if you will drop the fix proposed by you?

Regards,
Matthias

>  
>  	if (arg == PIN_CONFIG_INPUT_ENABLE)
>  		offset = pctl->devdata->ies_offset;
> 

  reply	other threads:[~2021-06-02 12:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-28  9:19 [PATCH] pinctrl: mediatek: move bit assignment Linus Walleij
2021-06-02 12:34 ` Matthias Brugger [this message]
2021-06-06 22:49   ` Linus Walleij

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=b3d9f92d-a311-0093-4243-b21f2646997f@gmail.com \
    --to=matthias.bgg@gmail.com \
    --cc=fparent@baylibre.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=lkp@intel.com \
    --cc=mkorpershoek@baylibre.com \
    --cc=sean.wang@kernel.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).