public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] usb: dwc2: host: fix Wmaybe-uninitialized warning
@ 2017-01-12 15:54 Nicholas Mc Guire
  2017-01-12 16:25 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 3+ messages in thread
From: Nicholas Mc Guire @ 2017-01-12 15:54 UTC (permalink / raw)
  To: John Youn; +Cc: Greg Kroah-Hartman, linux-usb, linux-kernel, Nicholas Mc Guire

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
---
Problem reported by sparse
drivers/usb/dwc2/hcd.c: In function 'dwc2_dump_urb_info':
./include/linux/dynamic_debug.h:134:3: warning: 'pipetype' may be used uninitialized in this function [-Wmaybe-uninitialized]
   __dynamic_dev_dbg(&descriptor, dev, fmt, \
   ^
drivers/usb/dwc2/hcd.c:4492:8: note: 'pipetype' was declared here
  char *pipetype;
        ^
Patch was compile tested with: x86_64_defconfig + CONFIG_USB_DWC2=m +
CONFIG_USB_DWC2_VERBOSE=y

Patch is against 4.10-rc3 (localversion-next is next-20170112)

 drivers/usb/dwc2/hcd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c
index 911c3b3..9f66777 100644
--- a/drivers/usb/dwc2/hcd.c
+++ b/drivers/usb/dwc2/hcd.c
@@ -4489,8 +4489,8 @@ static void dwc2_dump_urb_info(struct usb_hcd *hcd, struct urb *urb,
 {
 #ifdef VERBOSE_DEBUG
 	struct dwc2_hsotg *hsotg = dwc2_hcd_to_hsotg(hcd);
-	char *pipetype;
-	char *speed;
+	char *pipetype = NULL;
+	char *speed = NULL;
 
 	dev_vdbg(hsotg->dev, "%s, urb %p\n", fn_name, urb);
 	dev_vdbg(hsotg->dev, "  Device address: %d\n",
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] usb: dwc2: host: fix Wmaybe-uninitialized warning
  2017-01-12 15:54 [PATCH] usb: dwc2: host: fix Wmaybe-uninitialized warning Nicholas Mc Guire
@ 2017-01-12 16:25 ` Greg Kroah-Hartman
  2017-01-12 16:31   ` Nicholas Mc Guire
  0 siblings, 1 reply; 3+ messages in thread
From: Greg Kroah-Hartman @ 2017-01-12 16:25 UTC (permalink / raw)
  To: Nicholas Mc Guire; +Cc: John Youn, linux-usb, linux-kernel

On Thu, Jan 12, 2017 at 04:54:38PM +0100, Nicholas Mc Guire wrote:
> Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
> ---
> Problem reported by sparse
> drivers/usb/dwc2/hcd.c: In function 'dwc2_dump_urb_info':
> ./include/linux/dynamic_debug.h:134:3: warning: 'pipetype' may be used uninitialized in this function [-Wmaybe-uninitialized]
>    __dynamic_dev_dbg(&descriptor, dev, fmt, \
>    ^
> drivers/usb/dwc2/hcd.c:4492:8: note: 'pipetype' was declared here
>   char *pipetype;
>         ^
> Patch was compile tested with: x86_64_defconfig + CONFIG_USB_DWC2=m +
> CONFIG_USB_DWC2_VERBOSE=y

Put the above in the changelog text please, I can't take patches without
any changelog text :(

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] usb: dwc2: host: fix Wmaybe-uninitialized warning
  2017-01-12 16:25 ` Greg Kroah-Hartman
@ 2017-01-12 16:31   ` Nicholas Mc Guire
  0 siblings, 0 replies; 3+ messages in thread
From: Nicholas Mc Guire @ 2017-01-12 16:31 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Nicholas Mc Guire, John Youn, linux-usb, linux-kernel

On Thu, Jan 12, 2017 at 05:25:00PM +0100, Greg Kroah-Hartman wrote:
> On Thu, Jan 12, 2017 at 04:54:38PM +0100, Nicholas Mc Guire wrote:
> > Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
> > ---
> > Problem reported by sparse
> > drivers/usb/dwc2/hcd.c: In function 'dwc2_dump_urb_info':
> > ./include/linux/dynamic_debug.h:134:3: warning: 'pipetype' may be used uninitialized in this function [-Wmaybe-uninitialized]
> >    __dynamic_dev_dbg(&descriptor, dev, fmt, \
> >    ^
> > drivers/usb/dwc2/hcd.c:4492:8: note: 'pipetype' was declared here
> >   char *pipetype;
> >         ^
> > Patch was compile tested with: x86_64_defconfig + CONFIG_USB_DWC2=m +
> > CONFIG_USB_DWC2_VERBOSE=y
> 
> Put the above in the changelog text please, I can't take patches without
> any changelog text :(
>
sorry - simply forgot to put that in - just resent as V2

thx!
hofrat 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-01-12 16:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-12 15:54 [PATCH] usb: dwc2: host: fix Wmaybe-uninitialized warning Nicholas Mc Guire
2017-01-12 16:25 ` Greg Kroah-Hartman
2017-01-12 16:31   ` Nicholas Mc Guire

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox