* [PATCH -next] pinctrl: mediatek: remove set but not used variable 'e'
@ 2020-02-18 2:36 YueHaibing
2020-02-18 16:27 ` Matthias Brugger
2020-02-20 15:14 ` Linus Walleij
0 siblings, 2 replies; 3+ messages in thread
From: YueHaibing @ 2020-02-18 2:36 UTC (permalink / raw)
To: sean.wang, linus.walleij, matthias.bgg, light.hsieh
Cc: linux-mediatek, linux-gpio, linux-arm-kernel, linux-kernel, YueHaibing
drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c: In function mtk_hw_pin_field_lookup:
drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c:70:39: warning:
variable e set but not used [-Wunused-but-set-variable]
Since commit 3de7deefce69 ("pinctrl: mediatek: Check gpio pin
number and use binary search in mtk_hw_pin_field_lookup()"),
it is not used any more, so remove it, also remove redundant
assignment to variable c, it will be assigned a new value later
before used.
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c b/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c
index 1da9425..d3169a8 100644
--- a/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c
+++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c
@@ -67,7 +67,7 @@ static int mtk_hw_pin_field_lookup(struct mtk_pinctrl *hw,
const struct mtk_pin_desc *desc,
int field, struct mtk_pin_field *pfd)
{
- const struct mtk_pin_field_calc *c, *e;
+ const struct mtk_pin_field_calc *c;
const struct mtk_pin_reg_calc *rc;
int start = 0, end, check;
bool found = false;
@@ -82,8 +82,6 @@ static int mtk_hw_pin_field_lookup(struct mtk_pinctrl *hw,
}
end = rc->nranges - 1;
- c = rc->range;
- e = c + rc->nranges;
while (start <= end) {
check = (start + end) >> 1;
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH -next] pinctrl: mediatek: remove set but not used variable 'e'
2020-02-18 2:36 [PATCH -next] pinctrl: mediatek: remove set but not used variable 'e' YueHaibing
@ 2020-02-18 16:27 ` Matthias Brugger
2020-02-20 15:14 ` Linus Walleij
1 sibling, 0 replies; 3+ messages in thread
From: Matthias Brugger @ 2020-02-18 16:27 UTC (permalink / raw)
To: YueHaibing, sean.wang, linus.walleij, light.hsieh
Cc: linux-mediatek, linux-gpio, linux-arm-kernel, linux-kernel
On 18/02/2020 03:36, YueHaibing wrote:
> drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c: In function mtk_hw_pin_field_lookup:
> drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c:70:39: warning:
> variable e set but not used [-Wunused-but-set-variable]
>
> Since commit 3de7deefce69 ("pinctrl: mediatek: Check gpio pin
> number and use binary search in mtk_hw_pin_field_lookup()"),
> it is not used any more, so remove it, also remove redundant
> assignment to variable c, it will be assigned a new value later
> before used.
>
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>
> ---
> drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c b/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c
> index 1da9425..d3169a8 100644
> --- a/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c
> +++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c
> @@ -67,7 +67,7 @@ static int mtk_hw_pin_field_lookup(struct mtk_pinctrl *hw,
> const struct mtk_pin_desc *desc,
> int field, struct mtk_pin_field *pfd)
> {
> - const struct mtk_pin_field_calc *c, *e;
> + const struct mtk_pin_field_calc *c;
> const struct mtk_pin_reg_calc *rc;
> int start = 0, end, check;
> bool found = false;
> @@ -82,8 +82,6 @@ static int mtk_hw_pin_field_lookup(struct mtk_pinctrl *hw,
> }
>
> end = rc->nranges - 1;
> - c = rc->range;
> - e = c + rc->nranges;
>
> while (start <= end) {
> check = (start + end) >> 1;
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH -next] pinctrl: mediatek: remove set but not used variable 'e'
2020-02-18 2:36 [PATCH -next] pinctrl: mediatek: remove set but not used variable 'e' YueHaibing
2020-02-18 16:27 ` Matthias Brugger
@ 2020-02-20 15:14 ` Linus Walleij
1 sibling, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2020-02-20 15:14 UTC (permalink / raw)
To: YueHaibing
Cc: Sean Wang, Matthias Brugger, Light Hsieh,
moderated list:ARM/Mediatek SoC support,
open list:GPIO SUBSYSTEM, linux-arm-kernel, linux-kernel
On Tue, Feb 18, 2020 at 3:36 AM YueHaibing <yuehaibing@huawei.com> wrote:
> drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c: In function mtk_hw_pin_field_lookup:
> drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c:70:39: warning:
> variable e set but not used [-Wunused-but-set-variable]
>
> Since commit 3de7deefce69 ("pinctrl: mediatek: Check gpio pin
> number and use binary search in mtk_hw_pin_field_lookup()"),
> it is not used any more, so remove it, also remove redundant
> assignment to variable c, it will be assigned a new value later
> before used.
>
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Patch applied with Matthias Review tag.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-02-20 15:14 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-18 2:36 [PATCH -next] pinctrl: mediatek: remove set but not used variable 'e' YueHaibing
2020-02-18 16:27 ` Matthias Brugger
2020-02-20 15:14 ` Linus Walleij
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).