[2/2] usb: dwc3: fix build warnings

Message ID 1443727338-29320-2-git-send-email-balbi@ti.com
State Accepted
Commit c2ad4e1b9f965d4ee4a5630216ba4123a77e1784
Headers show

Commit Message

Felipe Balbi Oct. 1, 2015, 7:22 p.m.
fix the following build warnings:

drivers/usb/dwc3/core.c: In function ‘dwc3_uboot_init’:
drivers/usb/dwc3/core.c:625:6: warning: ‘dev’ is used uninitialized in this function [-Wuninitialized]
mem = devm_kzalloc(dev, sizeof(*dwc) + DWC3_ALIGN_MASK, GFP_KERNEL);
        ^
drivers/usb/dwc3/dwc3-omap.c: In function ‘dwc3_omap_uboot_init’:
drivers/usb/dwc3/dwc3-omap.c:380:7: warning: ‘dev’ is used uninitialized in this function [-Wuninitialized]
omap = devm_kzalloc(dev, sizeof(*omap), GFP_KERNEL);

Signed-off-by: Felipe Balbi <balbi@ti.com>
---
 drivers/usb/dwc3/core.c      | 2 +-
 drivers/usb/dwc3/dwc3-omap.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Felipe Balbi Oct. 16, 2015, 8:09 p.m. | #1
Felipe Balbi <balbi@ti.com> writes:

> fix the following build warnings:
>
> drivers/usb/dwc3/core.c: In function ‘dwc3_uboot_init’:
> drivers/usb/dwc3/core.c:625:6: warning: ‘dev’ is used uninitialized in this function [-Wuninitialized]
> mem = devm_kzalloc(dev, sizeof(*dwc) + DWC3_ALIGN_MASK, GFP_KERNEL);
>         ^
> drivers/usb/dwc3/dwc3-omap.c: In function ‘dwc3_omap_uboot_init’:
> drivers/usb/dwc3/dwc3-omap.c:380:7: warning: ‘dev’ is used uninitialized in this function [-Wuninitialized]
> omap = devm_kzalloc(dev, sizeof(*omap), GFP_KERNEL);
>
> Signed-off-by: Felipe Balbi <balbi@ti.com>

ping

> ---
>  drivers/usb/dwc3/core.c      | 2 +-
>  drivers/usb/dwc3/dwc3-omap.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
> index ab3c94e51275..a95d461a7cc4 100644
> --- a/drivers/usb/dwc3/core.c
> +++ b/drivers/usb/dwc3/core.c
> @@ -613,7 +613,7 @@ static void dwc3_core_exit_mode(struct dwc3 *dwc)
>  int dwc3_uboot_init(struct dwc3_device *dwc3_dev)
>  {
>  	struct dwc3		*dwc;
> -	struct device		*dev;
> +	struct device		*dev = NULL;
>  	u8			lpm_nyet_threshold;
>  	u8			tx_de_emphasis;
>  	u8			hird_threshold;
> diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c
> index ac9a856190f0..3dcc2f484777 100644
> --- a/drivers/usb/dwc3/dwc3-omap.c
> +++ b/drivers/usb/dwc3/dwc3-omap.c
> @@ -374,7 +374,7 @@ static void dwc3_omap_set_utmi_mode(struct dwc3_omap *omap, int utmi_mode)
>  int dwc3_omap_uboot_init(struct dwc3_omap_device *omap_dev)
>  {
>  	u32			reg;
> -	struct device		*dev;
> +	struct device		*dev = NULL;
>  	struct dwc3_omap	*omap;
>  
>  	omap = devm_kzalloc(dev, sizeof(*omap), GFP_KERNEL);
> -- 
> 2.5.3
>

Patch

diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index ab3c94e51275..a95d461a7cc4 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -613,7 +613,7 @@  static void dwc3_core_exit_mode(struct dwc3 *dwc)
 int dwc3_uboot_init(struct dwc3_device *dwc3_dev)
 {
 	struct dwc3		*dwc;
-	struct device		*dev;
+	struct device		*dev = NULL;
 	u8			lpm_nyet_threshold;
 	u8			tx_de_emphasis;
 	u8			hird_threshold;
diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c
index ac9a856190f0..3dcc2f484777 100644
--- a/drivers/usb/dwc3/dwc3-omap.c
+++ b/drivers/usb/dwc3/dwc3-omap.c
@@ -374,7 +374,7 @@  static void dwc3_omap_set_utmi_mode(struct dwc3_omap *omap, int utmi_mode)
 int dwc3_omap_uboot_init(struct dwc3_omap_device *omap_dev)
 {
 	u32			reg;
-	struct device		*dev;
+	struct device		*dev = NULL;
 	struct dwc3_omap	*omap;
 
 	omap = devm_kzalloc(dev, sizeof(*omap), GFP_KERNEL);