[U-Boot] [PATCH 1/2] USB: gadget: atmel: get rid of debug compile warning

When enable debug option to compile, it will give the following warning, this patch is used to get rid of it. --->8--- warning: 'flags' is used uninitialized in this function [-Wuninitialized] ---8<---
Signed-off-by: Bo Shen voice.shen@atmel.com ---
drivers/usb/gadget/atmel_usba_udc.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/usb/gadget/atmel_usba_udc.c b/drivers/usb/gadget/atmel_usba_udc.c index 2c70973..12628ef 100644 --- a/drivers/usb/gadget/atmel_usba_udc.c +++ b/drivers/usb/gadget/atmel_usba_udc.c @@ -171,7 +171,7 @@ usba_ep_enable(struct usb_ep *_ep, const struct usb_endpoint_descriptor *desc) { struct usba_ep *ep = to_usba_ep(_ep); struct usba_udc *udc = ep->udc; - unsigned long flags, ept_cfg, maxpacket; + unsigned long flags = 0, ept_cfg, maxpacket; unsigned int nr_trans;
DBG(DBG_GADGET, "%s: ep_enable: desc=%p\n", ep->ep.name, desc); @@ -274,7 +274,7 @@ static int usba_ep_disable(struct usb_ep *_ep) struct usba_ep *ep = to_usba_ep(_ep); struct usba_udc *udc = ep->udc; LIST_HEAD(req_list); - unsigned long flags; + unsigned long flags = 0;
DBG(DBG_GADGET, "ep_disable: %s\n", ep->ep.name);
@@ -339,7 +339,7 @@ usba_ep_queue(struct usb_ep *_ep, struct usb_request *_req, gfp_t gfp_flags) struct usba_request *req = to_usba_req(_req); struct usba_ep *ep = to_usba_ep(_ep); struct usba_udc *udc = ep->udc; - unsigned long flags; + unsigned long flags = 0; int ret;
DBG(DBG_GADGET | DBG_QUEUE | DBG_REQ, "%s: queue req %p, len %u\n", @@ -401,7 +401,7 @@ static int usba_ep_dequeue(struct usb_ep *_ep, struct usb_request *_req) static int usba_ep_set_halt(struct usb_ep *_ep, int value) { struct usba_ep *ep = to_usba_ep(_ep); - unsigned long flags; + unsigned long flags = 0; int ret = 0;
DBG(DBG_GADGET, "endpoint %s: %s HALT\n", ep->ep.name, @@ -480,7 +480,7 @@ static int usba_udc_get_frame(struct usb_gadget *gadget) static int usba_udc_wakeup(struct usb_gadget *gadget) { struct usba_udc *udc = to_usba_udc(gadget); - unsigned long flags; + unsigned long flags = 0; u32 ctrl; int ret = -EINVAL;
@@ -499,7 +499,7 @@ static int usba_udc_set_selfpowered(struct usb_gadget *gadget, int is_selfpowered) { struct usba_udc *udc = to_usba_udc(gadget); - unsigned long flags; + unsigned long flags = 0;
spin_lock_irqsave(&udc->lock, flags); if (is_selfpowered)

When enable debug option to compile, it will give the following warning, this patch is used to get rid of it. --->8--- warning: 'flags' is used uninitialized in this function [-Wuninitialized] ---8<---
Signed-off-by: Bo Shen voice.shen@atmel.com ---
drivers/usb/gadget/s3c_udc_otg.c | 10 +++++----- drivers/usb/gadget/s3c_udc_otg_xfer_dma.c | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/usb/gadget/s3c_udc_otg.c b/drivers/usb/gadget/s3c_udc_otg.c index 63d4487..a8856bd 100644 --- a/drivers/usb/gadget/s3c_udc_otg.c +++ b/drivers/usb/gadget/s3c_udc_otg.c @@ -283,7 +283,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver) { struct s3c_udc *dev = the_controller; int retval = 0; - unsigned long flags; + unsigned long flags = 0;
debug_cond(DEBUG_SETUP != 0, "%s: %s\n", __func__, "no name");
@@ -331,7 +331,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver) int usb_gadget_unregister_driver(struct usb_gadget_driver *driver) { struct s3c_udc *dev = the_controller; - unsigned long flags; + unsigned long flags = 0;
if (!dev) return -ENODEV; @@ -575,7 +575,7 @@ static int s3c_ep_enable(struct usb_ep *_ep, { struct s3c_ep *ep; struct s3c_udc *dev; - unsigned long flags; + unsigned long flags = 0;
debug("%s: %p\n", __func__, _ep);
@@ -639,7 +639,7 @@ static int s3c_ep_enable(struct usb_ep *_ep, static int s3c_ep_disable(struct usb_ep *_ep) { struct s3c_ep *ep; - unsigned long flags; + unsigned long flags = 0;
debug("%s: %p\n", __func__, _ep);
@@ -697,7 +697,7 @@ static int s3c_dequeue(struct usb_ep *_ep, struct usb_request *_req) { struct s3c_ep *ep; struct s3c_request *req; - unsigned long flags; + unsigned long flags = 0;
debug("%s: %p\n", __func__, _ep);
diff --git a/drivers/usb/gadget/s3c_udc_otg_xfer_dma.c b/drivers/usb/gadget/s3c_udc_otg_xfer_dma.c index 06dfeed..4f69b22 100644 --- a/drivers/usb/gadget/s3c_udc_otg_xfer_dma.c +++ b/drivers/usb/gadget/s3c_udc_otg_xfer_dma.c @@ -466,7 +466,7 @@ static int s3c_udc_irq(int irq, void *_dev) struct s3c_udc *dev = _dev; u32 intr_status; u32 usb_status, gintmsk; - unsigned long flags; + unsigned long flags = 0;
spin_lock_irqsave(&dev->lock, flags);
@@ -585,7 +585,7 @@ static int s3c_queue(struct usb_ep *_ep, struct usb_request *_req, struct s3c_request *req; struct s3c_ep *ep; struct s3c_udc *dev; - unsigned long flags; + unsigned long flags = 0; u32 ep_num, gintsts;
req = container_of(_req, struct s3c_request, req); @@ -1033,7 +1033,7 @@ static int s3c_udc_set_halt(struct usb_ep *_ep, int value) { struct s3c_ep *ep; struct s3c_udc *dev; - unsigned long flags; + unsigned long flags = 0; u8 ep_num;
ep = container_of(_ep, struct s3c_ep, ep);

On Wednesday, August 27, 2014 at 11:28:18 AM, Bo Shen wrote:
When enable debug option to compile, it will give the following warning, this patch is used to get rid of it. --->8--- warning: 'flags' is used uninitialized in this function [-Wuninitialized] ---8<---
Signed-off-by: Bo Shen voice.shen@atmel.com
Are those two still relevant with u-boot/master please ?
Best regards, Marek Vasut

Hi Marek,
On 08/29/2014 05:34 PM, Marek Vasut wrote:
On Wednesday, August 27, 2014 at 11:28:18 AM, Bo Shen wrote:
When enable debug option to compile, it will give the following warning, this patch is used to get rid of it. --->8--- warning: 'flags' is used uninitialized in this function [-Wuninitialized] ---8<---
Signed-off-by: Bo Shen voice.shen@atmel.com
Are those two still relevant with u-boot/master please ?
As the patch applied on u-boot/master is different with [1], so we still need this patch series.
[1] http://patchwork.ozlabs.org/patch/363333/
Best regards, Marek Vasut
Best Regards, Bo Shen

On Monday, September 01, 2014 at 04:59:39 AM, Bo Shen wrote:
Hi Marek,
On 08/29/2014 05:34 PM, Marek Vasut wrote:
On Wednesday, August 27, 2014 at 11:28:18 AM, Bo Shen wrote:
When enable debug option to compile, it will give the following warning, this patch is used to get rid of it. --->8--- warning: 'flags' is used uninitialized in this function [-Wuninitialized] ---8<---
Signed-off-by: Bo Shen voice.shen@atmel.com
Are those two still relevant with u-boot/master please ?
As the patch applied on u-boot/master is different with [1], so we still need this patch series.
Will pick, thanks for the checking!
Best regards, Marek Vasut
participants (2)
-
Bo Shen
-
Marek Vasut