Message ID | 1353048646-10935-7-git-send-email-tushar.behera@linaro.org |
---|---|
State | Accepted |
Commit | 4a991b410cd7940c48f261e854e8698923e23fd2 |
Headers | show |
On Fri, Nov 16, 2012 at 7:50 AM, Tushar Behera <tushar.behera@linaro.org> wrote: > Checking '< 0' for unsigned variables always returns false. For error > codes, use IS_ERR_VALUE() instead. > > CC: Linus Walleij <linus.walleij@linaro.org> > Signed-off-by: Tushar Behera <tushar.behera@linaro.org> > --- > drivers/pinctrl/pinctrl-samsung.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/drivers/pinctrl/pinctrl-samsung.c b/drivers/pinctrl/pinctrl-samsung.c > index 81c9896..3b52c17 100644 > --- a/drivers/pinctrl/pinctrl-samsung.c > +++ b/drivers/pinctrl/pinctrl-samsung.c > @@ -560,7 +560,7 @@ static int __devinit samsung_pinctrl_parse_dt_pins(struct platform_device *pdev, > const char *pin_name; > > *npins = of_property_count_strings(cfg_np, "samsung,pins"); > - if (*npins < 0) { > + if (IS_ERR_VALUE(*npins)) { > dev_err(dev, "invalid pin list in %s node", cfg_np->name); > return -EINVAL; > } Acked-by: Linus Walleij <linus.walleij@linaro.org> For this merge window Kukjin is handling the Samsung pinctrl patches, Kukjin can you pick this to your tree to avoid any mess? Yours, Linus Walleij
Linus Walleij wrote: > > On Fri, Nov 16, 2012 at 7:50 AM, Tushar Behera <tushar.behera@linaro.org> > wrote: > > > Checking '< 0' for unsigned variables always returns false. For error > > codes, use IS_ERR_VALUE() instead. > > > > CC: Linus Walleij <linus.walleij@linaro.org> > > Signed-off-by: Tushar Behera <tushar.behera@linaro.org> > > --- > > drivers/pinctrl/pinctrl-samsung.c | 2 +- > > 1 files changed, 1 insertions(+), 1 deletions(-) > > > > diff --git a/drivers/pinctrl/pinctrl-samsung.c > b/drivers/pinctrl/pinctrl-samsung.c > > index 81c9896..3b52c17 100644 > > --- a/drivers/pinctrl/pinctrl-samsung.c > > +++ b/drivers/pinctrl/pinctrl-samsung.c > > @@ -560,7 +560,7 @@ static int __devinit > samsung_pinctrl_parse_dt_pins(struct platform_device *pdev, > > const char *pin_name; > > > > *npins = of_property_count_strings(cfg_np, "samsung,pins"); > > - if (*npins < 0) { > > + if (IS_ERR_VALUE(*npins)) { > > dev_err(dev, "invalid pin list in %s node", cfg_np->name); > > return -EINVAL; > > } > > Acked-by: Linus Walleij <linus.walleij@linaro.org> > > For this merge window Kukjin is handling the Samsung pinctrl patches, > Kukjin can you pick this to your tree to avoid any mess? > Sure, I will. Thanks. Best regards, Kgene. -- Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.
diff --git a/drivers/pinctrl/pinctrl-samsung.c b/drivers/pinctrl/pinctrl-samsung.c index 81c9896..3b52c17 100644 --- a/drivers/pinctrl/pinctrl-samsung.c +++ b/drivers/pinctrl/pinctrl-samsung.c @@ -560,7 +560,7 @@ static int __devinit samsung_pinctrl_parse_dt_pins(struct platform_device *pdev, const char *pin_name; *npins = of_property_count_strings(cfg_np, "samsung,pins"); - if (*npins < 0) { + if (IS_ERR_VALUE(*npins)) { dev_err(dev, "invalid pin list in %s node", cfg_np->name); return -EINVAL; }
Checking '< 0' for unsigned variables always returns false. For error codes, use IS_ERR_VALUE() instead. CC: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Tushar Behera <tushar.behera@linaro.org> --- drivers/pinctrl/pinctrl-samsung.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)