Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1557932
| Path | csiph.com!1.us.feeder.erje.net!2.us.feeder.erje.net!feeder.erje.net!2.eu.feeder.erje.net!news.unit0.net!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | John Youn <John.Youn@synopsys.com> |
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH V2] usb: dwc2: host: fix Wmaybe-uninitialized warning |
| Date | Fri, 13 Jan 2017 01:40:01 +0100 |
| Message-ID | <sYY4p-2nT-3@gated-at.bofh.it> (permalink) |
| References | <sYQzV-6d7-49@gated-at.bofh.it> |
| User-Agent | Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset="utf-8" |
| Content-Transfer-Encoding | 7bit |
| X-Originating-IP | [10.9.138.255] |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 48 |
| Organization | linux.* mail to news gateway |
| X-Original-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> |
| X-Original-Date | Thu, 12 Jan 2017 16:30:58 -0800 |
| X-Original-Message-ID | <d8ca5752-79e0-ddc6-a6ec-01c3e4bba703@synopsys.com> |
| X-Original-References | <1484238806-13977-1-git-send-email-hofrat@osadl.org> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1557932 |
Show key headers only | View raw
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
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH V2] usb: dwc2: host: fix Wmaybe-uninitialized warning Nicholas Mc Guire <hofrat@osadl.org> - 2017-01-12 17:40 +0100 Re: [PATCH V2] usb: dwc2: host: fix Wmaybe-uninitialized warning John Youn <John.Youn@synopsys.com> - 2017-01-13 01:40 +0100
csiph-web