* [PATCH] pinctrl: remove redundant pin < 0 check on unsigned int
@ 2017-01-13 13:20 Colin King
2017-01-13 20:41 ` Nishanth Menon
2017-01-18 9:24 ` Linus Walleij
0 siblings, 2 replies; 4+ messages in thread
From: Colin King @ 2017-01-13 13:20 UTC (permalink / raw)
To: Linus Walleij, Lokesh Vutla, Tony Lindgren, Nishanth Menon, linux-gpio
Cc: linux-kernel
From: Colin Ian King <colin.king@canonical.com>
pin is an unsigned int and therefore can never be < 0 so
this check is redudant. Remove the check and the associated
dev_err error message.
Fixes CoverityScan CID#1396438 ("Unsigned compared against 0")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/pinctrl/ti/pinctrl-ti-iodelay.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/drivers/pinctrl/ti/pinctrl-ti-iodelay.c b/drivers/pinctrl/ti/pinctrl-ti-iodelay.c
index 3b86d3d..a345166 100644
--- a/drivers/pinctrl/ti/pinctrl-ti-iodelay.c
+++ b/drivers/pinctrl/ti/pinctrl-ti-iodelay.c
@@ -665,12 +665,6 @@ static void ti_iodelay_pin_dbg_show(struct pinctrl_dev *pctldev,
r = iod->reg_data;
offset = ti_iodelay_pin_to_offset(iod, pin);
- if (pin < 0) {
- dev_err(iod->dev, "invalid pin offset for pin%i\n", pin);
-
- return;
- }
-
pd = &iod->pa[pin];
cfg = pd->drv_data;
--
2.10.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] pinctrl: remove redundant pin < 0 check on unsigned int
2017-01-13 13:20 [PATCH] pinctrl: remove redundant pin < 0 check on unsigned int Colin King
@ 2017-01-13 20:41 ` Nishanth Menon
2017-01-18 9:24 ` Linus Walleij
1 sibling, 0 replies; 4+ messages in thread
From: Nishanth Menon @ 2017-01-13 20:41 UTC (permalink / raw)
To: Colin King, Linus Walleij, Lokesh Vutla, Tony Lindgren, linux-gpio
Cc: linux-kernel
On 01/13/2017 07:20 AM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> pin is an unsigned int and therefore can never be < 0 so
> this check is redudant. Remove the check and the associated
s/redudant/redundant/
> dev_err error message.
>
> Fixes CoverityScan CID#1396438 ("Unsigned compared against 0")
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
> drivers/pinctrl/ti/pinctrl-ti-iodelay.c | 6 ------
> 1 file changed, 6 deletions(-)
>
> diff --git a/drivers/pinctrl/ti/pinctrl-ti-iodelay.c b/drivers/pinctrl/ti/pinctrl-ti-iodelay.c
> index 3b86d3d..a345166 100644
> --- a/drivers/pinctrl/ti/pinctrl-ti-iodelay.c
> +++ b/drivers/pinctrl/ti/pinctrl-ti-iodelay.c
> @@ -665,12 +665,6 @@ static void ti_iodelay_pin_dbg_show(struct pinctrl_dev *pctldev,
> r = iod->reg_data;
>
> offset = ti_iodelay_pin_to_offset(iod, pin);
> - if (pin < 0) {
> - dev_err(iod->dev, "invalid pin offset for pin%i\n", pin);
> -
> - return;
> - }
> -
> pd = &iod->pa[pin];
> cfg = pd->drv_data;
>
>
Thanks.
just the $subject could probably be "pinctrl: ti-iodelay:..."
Other than these:
Acked-by: Nishanth Menon <nm@ti.com>
--
Regards,
Nishanth Menon
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] pinctrl: remove redundant pin < 0 check on unsigned int
@ 2017-01-13 20:41 ` Nishanth Menon
0 siblings, 0 replies; 4+ messages in thread
From: Nishanth Menon @ 2017-01-13 20:41 UTC (permalink / raw)
To: Colin King, Linus Walleij, Lokesh Vutla, Tony Lindgren, linux-gpio
Cc: linux-kernel
On 01/13/2017 07:20 AM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> pin is an unsigned int and therefore can never be < 0 so
> this check is redudant. Remove the check and the associated
s/redudant/redundant/
> dev_err error message.
>
> Fixes CoverityScan CID#1396438 ("Unsigned compared against 0")
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
> drivers/pinctrl/ti/pinctrl-ti-iodelay.c | 6 ------
> 1 file changed, 6 deletions(-)
>
> diff --git a/drivers/pinctrl/ti/pinctrl-ti-iodelay.c b/drivers/pinctrl/ti/pinctrl-ti-iodelay.c
> index 3b86d3d..a345166 100644
> --- a/drivers/pinctrl/ti/pinctrl-ti-iodelay.c
> +++ b/drivers/pinctrl/ti/pinctrl-ti-iodelay.c
> @@ -665,12 +665,6 @@ static void ti_iodelay_pin_dbg_show(struct pinctrl_dev *pctldev,
> r = iod->reg_data;
>
> offset = ti_iodelay_pin_to_offset(iod, pin);
> - if (pin < 0) {
> - dev_err(iod->dev, "invalid pin offset for pin%i\n", pin);
> -
> - return;
> - }
> -
> pd = &iod->pa[pin];
> cfg = pd->drv_data;
>
>
Thanks.
just the $subject could probably be "pinctrl: ti-iodelay:..."
Other than these:
Acked-by: Nishanth Menon <nm@ti.com>
--
Regards,
Nishanth Menon
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] pinctrl: remove redundant pin < 0 check on unsigned int
2017-01-13 13:20 [PATCH] pinctrl: remove redundant pin < 0 check on unsigned int Colin King
2017-01-13 20:41 ` Nishanth Menon
@ 2017-01-18 9:24 ` Linus Walleij
1 sibling, 0 replies; 4+ messages in thread
From: Linus Walleij @ 2017-01-18 9:24 UTC (permalink / raw)
To: Colin King
Cc: Lokesh Vutla, Tony Lindgren, Nishanth Menon, linux-gpio, linux-kernel
On Fri, Jan 13, 2017 at 2:20 PM, Colin King <colin.king@canonical.com> wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> pin is an unsigned int and therefore can never be < 0 so
> this check is redudant. Remove the check and the associated
> dev_err error message.
>
> Fixes CoverityScan CID#1396438 ("Unsigned compared against 0")
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Fixed up speling & commit topic and applied with
Nishanth's ACK!
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-01-18 9:24 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-13 13:20 [PATCH] pinctrl: remove redundant pin < 0 check on unsigned int Colin King
2017-01-13 20:41 ` Nishanth Menon
2017-01-13 20:41 ` Nishanth Menon
2017-01-18 9:24 ` Linus Walleij
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.