From: Hongzhou Yang <hongzhou.yang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
To: Andrzej Hajda <a.hajda-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
Cc: Bartlomiej Zolnierkiewicz
<b.zolnierkie-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
Biao Huang <biao.huang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>,
Linus Walleij
<linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
"open list:PIN CONTROL SUBSYSTEM"
<linux-gpio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
"moderated list:ARM/Mediatek SoC support"
<linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
Matthias Brugger
<matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Yingjoe Chen
<yingjoe.chen-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>,
Marek Szyprowski
<m.szyprowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
Subject: Re: [PATCH] pinctrl: mediatek: fix handling return value of mtk_pmx_find_gpio_mode
Date: Thu, 11 Feb 2016 18:59:38 -0800 [thread overview]
Message-ID: <1455245978.12131.0.camel@mussux00> (raw)
In-Reply-To: <1455201248-4988-1-git-send-email-a.hajda-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
On Thu, 2016-02-11 at 15:34 +0100, Andrzej Hajda wrote:
> The function can return negative values, so its result should
> be assigned to signed variable.
>
> The problem has been detected using coccinelle semantic patch
> scripts/coccinelle/tests/assign_signed_to_unsigned.cocci.
>
> Fixes: 59ee9c9 ('pinctrl: mediatek: Add gpio_request_enable support')
> Signed-off-by: Andrzej Hajda <a.hajda-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.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 cbc2204..ddc9217 100644
> --- a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
> +++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
> @@ -755,7 +755,7 @@ static int mtk_pmx_gpio_request_enable(struct pinctrl_dev *pctldev,
> struct pinctrl_gpio_range *range,
> unsigned offset)
> {
> - unsigned long muxval;
> + int muxval;
> struct mtk_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev);
>
> muxval = mtk_pmx_find_gpio_mode(pctl, offset);
Thank you very much.
Acked-by: Hongzhou Yang <hongzhou.yang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
Yours,
Hongzhou
next prev parent reply other threads:[~2016-02-12 2:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-11 14:34 [PATCH] pinctrl: mediatek: fix handling return value of mtk_pmx_find_gpio_mode Andrzej Hajda
[not found] ` <1455201248-4988-1-git-send-email-a.hajda-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2016-02-12 2:59 ` Hongzhou Yang [this message]
2016-02-15 23:31 ` 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=1455245978.12131.0.camel@mussux00 \
--to=hongzhou.yang-nus5lvnupcjwk0htik3j/w@public.gmane.org \
--cc=a.hajda-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
--cc=b.zolnierkie-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
--cc=biao.huang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org \
--cc=linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=linux-gpio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=m.szyprowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
--cc=matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=yingjoe.chen-NuS5LvNUpcJWk0Htik3J/w@public.gmane.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