From: Colin Ian King <[email protected]>
Fix warning: drivers/usb/misc/usb3503.c:195:11: warning: 'err'
may be used uninitialized in this function [-Wmaybe-uninitialized]
err is not initialized, the error return should be PTR_ERR(clk)
Signed-off-by: Colin Ian King <[email protected]>
---
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..c0c898d 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);
}
--
2.0.0
On Monday, June 30, 2014 6:43 AM, Colin King wrote:
>
> From: Colin Ian King <[email protected]>
>
> Fix warning: drivers/usb/misc/usb3503.c:195:11: warning: 'err'
> may be used uninitialized in this function [-Wmaybe-uninitialized]
>
> err is not initialized, the error return should be PTR_ERR(clk)
>
> Signed-off-by: Colin Ian King <[email protected]>
It looks good!
Reviewed-by: Jingoo Han <[email protected]>
Best regards,
Jingoo Han
> ---
> 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..c0c898d 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);
> }
>
> --
> 2.0.0
On Sun, Jun 29, 2014 at 10:42:53PM +0100, Colin King wrote:
> From: Colin Ian King <[email protected]>
>
> Fix warning: drivers/usb/misc/usb3503.c:195:11: warning: 'err'
> may be used uninitialized in this function [-Wmaybe-uninitialized]
>
> err is not initialized, the error return should be PTR_ERR(clk)
>
> Signed-off-by: Colin Ian King <[email protected]>
> Reviewed-by: Jingoo Han <[email protected]>
> ---
> 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..c0c898d 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);
> }
>
This doesn't apply to my tree at all :(