From: John Youn <John.Youn@synopsys.com>
To: Nicholas Mc Guire <hofrat@osadl.org>,
John Youn <John.Youn@synopsys.com>,
Felipe Balbi <balbi@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH V2] usb: dwc2: host: fix Wmaybe-uninitialized warning
Date: Thu, 12 Jan 2017 16:30:58 -0800 [thread overview]
Message-ID: <d8ca5752-79e0-ddc6-a6ec-01c3e4bba703@synopsys.com> (raw)
In-Reply-To: <1484238806-13977-1-git-send-email-hofrat@osadl.org>
On 1/12/2017 8:32 AM, Nicholas Mc Guire wrote:
> Uninitialized char* causes a sparse build-warning, fix it up by
> initializing it to NULL.
>
> Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
> ---
>
> V2: add missing change-log as requested by Greg Kroah-Hartman
> <gregkh@linuxfoundation.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",
>
+Felipe
Acked-by: John Youn <johnyoun@synopsys.com>
John
prev parent reply other threads:[~2017-01-13 0:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-12 16:33 Nicholas Mc Guire
2017-01-13 0:30 ` John Youn [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d8ca5752-79e0-ddc6-a6ec-01c3e4bba703@synopsys.com \
--to=john.youn@synopsys.com \
--cc=balbi@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=hofrat@osadl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®