2014-06-17 11:11:52

by Tushar Behera

[permalink] [raw]
Subject: [PATCH] usb: misc: usb3503: Update error code in print message

'err' is uninitialized, rather print the error code directly.

This also fixes following warning.
drivers/usb/misc/usb3503.c: In function ‘usb3503_probe’:
drivers/usb/misc/usb3503.c:195:11: warning: ‘err’ may be used uninitialized
in this function [-Wmaybe-uninitialized]
dev_err(dev, "unable to request refclk (%d)\n", err);

Signed-off-by: Tushar Behera <[email protected]>
---

Based on next-20140616.

drivers/usb/misc/usb3503.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/misc/usb3503.c b/drivers/usb/misc/usb3503.c
index f43c619..652855b 100644
--- a/drivers/usb/misc/usb3503.c
+++ b/drivers/usb/misc/usb3503.c
@@ -192,7 +192,8 @@ static int usb3503_probe(struct usb3503 *hub)

clk = devm_clk_get(dev, "refclk");
if (IS_ERR(clk) && PTR_ERR(clk) != -ENOENT) {
- dev_err(dev, "unable to request refclk (%d)\n", err);
+ dev_err(dev, "unable to request refclk (%ld)\n",
+ PTR_ERR(clk));
return PTR_ERR(clk);
}

--
1.7.9.5


2014-06-17 11:24:31

by Marek Szyprowski

[permalink] [raw]
Subject: Re: [PATCH] usb: misc: usb3503: Update error code in print message

Hello,

On 2014-06-17 13:08, Tushar Behera wrote:
> 'err' is uninitialized, rather print the error code directly.
>
> This also fixes following warning.
> drivers/usb/misc/usb3503.c: In function ‘usb3503_probe’:
> drivers/usb/misc/usb3503.c:195:11: warning: ‘err’ may be used uninitialized
> in this function [-Wmaybe-uninitialized]
> dev_err(dev, "unable to request refclk (%d)\n", err);
>
> Signed-off-by: Tushar Behera <[email protected]>

Acked-by: Marek Szyprowski <[email protected]>

> ---
>
> Based on next-20140616.
>
> drivers/usb/misc/usb3503.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/usb/misc/usb3503.c b/drivers/usb/misc/usb3503.c
> index f43c619..652855b 100644
> --- a/drivers/usb/misc/usb3503.c
> +++ b/drivers/usb/misc/usb3503.c
> @@ -192,7 +192,8 @@ static int usb3503_probe(struct usb3503 *hub)
>
> clk = devm_clk_get(dev, "refclk");
> if (IS_ERR(clk) && PTR_ERR(clk) != -ENOENT) {
> - dev_err(dev, "unable to request refclk (%d)\n", err);
> + dev_err(dev, "unable to request refclk (%ld)\n",
> + PTR_ERR(clk));
> return PTR_ERR(clk);
> }
>

Best regards
--
Marek Szyprowski, PhD
Samsung R&D Institute Poland

2014-06-23 06:17:41

by Tushar Behera

[permalink] [raw]
Subject: Re: [PATCH] usb: misc: usb3503: Update error code in print message

On 06/17/2014 04:54 PM, Marek Szyprowski wrote:
> Hello,
>
> On 2014-06-17 13:08, Tushar Behera wrote:
>> 'err' is uninitialized, rather print the error code directly.
>>
>> This also fixes following warning.
>> drivers/usb/misc/usb3503.c: In function ?usb3503_probe?:
>> drivers/usb/misc/usb3503.c:195:11: warning: ?err? may be used
>> uninitialized
>> in this function [-Wmaybe-uninitialized]
>> dev_err(dev, "unable to request refclk (%d)\n", err);
>>
>> Signed-off-by: Tushar Behera <[email protected]>
>
> Acked-by: Marek Szyprowski <[email protected]>
>

Greg,

Would you please pick up this patch?

>> ---
>>
>> Based on next-20140616.
>>
>> drivers/usb/misc/usb3503.c | 3 ++-
>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/usb/misc/usb3503.c b/drivers/usb/misc/usb3503.c
>> index f43c619..652855b 100644
>> --- a/drivers/usb/misc/usb3503.c
>> +++ b/drivers/usb/misc/usb3503.c
>> @@ -192,7 +192,8 @@ static int usb3503_probe(struct usb3503 *hub)
>> clk = devm_clk_get(dev, "refclk");
>> if (IS_ERR(clk) && PTR_ERR(clk) != -ENOENT) {
>> - dev_err(dev, "unable to request refclk (%d)\n", err);
>> + dev_err(dev, "unable to request refclk (%ld)\n",
>> + PTR_ERR(clk));
>> return PTR_ERR(clk);
>> }
>>
>
> Best regards


--
Tushar Behera

2014-06-23 16:18:33

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH] usb: misc: usb3503: Update error code in print message

On Mon, Jun 23, 2014 at 11:47:35AM +0530, Tushar Behera wrote:
> On 06/17/2014 04:54 PM, Marek Szyprowski wrote:
> > Hello,
> >
> > On 2014-06-17 13:08, Tushar Behera wrote:
> >> 'err' is uninitialized, rather print the error code directly.
> >>
> >> This also fixes following warning.
> >> drivers/usb/misc/usb3503.c: In function ‘usb3503_probe’:
> >> drivers/usb/misc/usb3503.c:195:11: warning: ‘err’ may be used
> >> uninitialized
> >> in this function [-Wmaybe-uninitialized]
> >> dev_err(dev, "unable to request refclk (%d)\n", err);
> >>
> >> Signed-off-by: Tushar Behera <[email protected]>
> >
> > Acked-by: Marek Szyprowski <[email protected]>
> >
>
> Greg,
>
> Would you please pick up this patch?

Give me a chance, it's in my todo queue...