Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1558405 > unrolled thread

[PATCH] pinctrl: remove redundant pin < 0 check on unsigned int

Started byColin King <colin.king@canonical.com>
First post2017-01-13 14:30 +0100
Last post2017-01-13 21:50 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] pinctrl: remove redundant pin < 0 check on unsigned int Colin King <colin.king@canonical.com> - 2017-01-13 14:30 +0100
    Re: [PATCH] pinctrl: remove redundant pin < 0 check on unsigned int Nishanth Menon <nm@ti.com> - 2017-01-13 21:50 +0100

#1558405 — [PATCH] pinctrl: remove redundant pin < 0 check on unsigned int

FromColin King <colin.king@canonical.com>
Date2017-01-13 14:30 +0100
Subject[PATCH] pinctrl: remove redundant pin < 0 check on unsigned int
Message-ID<sZa5A-1nw-25@gated-at.bofh.it>
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

[toc] | [next] | [standalone]


#1558744

FromNishanth Menon <nm@ti.com>
Date2017-01-13 21:50 +0100
Message-ID<sZgXo-5qX-19@gated-at.bofh.it>
In reply to#1558405
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

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web