linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] usb: xhci: remove the code build warning
@ 2018-06-06 14:36 Dongjiu Geng
  2018-06-11 12:30 ` gengdongjiu
  2018-06-15 10:40 ` Greg KH
  0 siblings, 2 replies; 4+ messages in thread
From: Dongjiu Geng @ 2018-06-06 14:36 UTC (permalink / raw)
  To: mathias.nyman, gregkh, thierry.reding, jonathanh, linux-usb,
	linux-tegra, linux-kernel, gengdongjiu

Initialize the 'err' variate to remove the build warning,
the warning is shown as below:

drivers/usb/host/xhci-tegra.c: In function 'tegra_xusb_mbox_thread':
drivers/usb/host/xhci-tegra.c:552:6: warning: 'err' may be used uninitialized in this function [-Wuninitialized]
drivers/usb/host/xhci-tegra.c:482:6: note: 'err' was declared here

Signed-off-by: Dongjiu Geng <gengdongjiu@huawei.com>
Acked-by: Thierry Reding <treding@nvidia.com>
---
How to reproduce:
1. make defconfig ARCH=arm
2. make -j100 CROSS_COMPILE=arm-linux-gnueabi- ARCH=arm

Then you can see below warnings:
drivers/usb/host/xhci-tegra.c: In function 'tegra_xusb_mbox_thread':
drivers/usb/host/xhci-tegra.c:552:6: warning: 'err' may be used uninitialized in this function [-Wuninitialized]
drivers/usb/host/xhci-tegra.c:482:6: note: 'err' was declared here
---
 drivers/usb/host/xhci-tegra.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/host/xhci-tegra.c b/drivers/usb/host/xhci-tegra.c
index a8c1d07..d50549f 100644
--- a/drivers/usb/host/xhci-tegra.c
+++ b/drivers/usb/host/xhci-tegra.c
@@ -481,7 +481,7 @@ static void tegra_xusb_mbox_handle(struct tegra_xusb *tegra,
 	unsigned long mask;
 	unsigned int port;
 	bool idle, enable;
-	int err;
+	int err = 0;
 
 	memset(&rsp, 0, sizeof(rsp));
 
-- 
1.9.1

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

* Re: [PATCH v2] usb: xhci: remove the code build warning
  2018-06-06 14:36 [PATCH v2] usb: xhci: remove the code build warning Dongjiu Geng
@ 2018-06-11 12:30 ` gengdongjiu
  2018-06-15 10:40 ` Greg KH
  1 sibling, 0 replies; 4+ messages in thread
From: gengdongjiu @ 2018-06-11 12:30 UTC (permalink / raw)
  To: mathias.nyman, gregkh, thierry.reding, jonathanh, linux-usb,
	linux-tegra, linux-kernel

Hi Mathias,
   This patch is ready to apply, It is great that this patch can be applied to 4.18. thanks a lot.

On 2018/6/6 22:36, Dongjiu Geng wrote:
> Initialize the 'err' variate to remove the build warning,
> the warning is shown as below:
> 
> drivers/usb/host/xhci-tegra.c: In function 'tegra_xusb_mbox_thread':
> drivers/usb/host/xhci-tegra.c:552:6: warning: 'err' may be used uninitialized in this function [-Wuninitialized]
> drivers/usb/host/xhci-tegra.c:482:6: note: 'err' was declared here
> 
> Signed-off-by: Dongjiu Geng <gengdongjiu@huawei.com>
> Acked-by: Thierry Reding <treding@nvidia.com>
> ---
> How to reproduce:
> 1. make defconfig ARCH=arm
> 2. make -j100 CROSS_COMPILE=arm-linux-gnueabi- ARCH=arm
> 
> Then you can see below warnings:
> drivers/usb/host/xhci-tegra.c: In function 'tegra_xusb_mbox_thread':
> drivers/usb/host/xhci-tegra.c:552:6: warning: 'err' may be used uninitialized in this function [-Wuninitialized]
> drivers/usb/host/xhci-tegra.c:482:6: note: 'err' was declared here
> ---
>  drivers/usb/host/xhci-tegra.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/host/xhci-tegra.c b/drivers/usb/host/xhci-tegra.c
> index a8c1d07..d50549f 100644
> --- a/drivers/usb/host/xhci-tegra.c
> +++ b/drivers/usb/host/xhci-tegra.c
> @@ -481,7 +481,7 @@ static void tegra_xusb_mbox_handle(struct tegra_xusb *tegra,
>  	unsigned long mask;
>  	unsigned int port;
>  	bool idle, enable;
> -	int err;
> +	int err = 0;
>  
>  	memset(&rsp, 0, sizeof(rsp));
>  
> 

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

* Re: [PATCH v2] usb: xhci: remove the code build warning
  2018-06-06 14:36 [PATCH v2] usb: xhci: remove the code build warning Dongjiu Geng
  2018-06-11 12:30 ` gengdongjiu
@ 2018-06-15 10:40 ` Greg KH
  2018-06-16  9:08   ` 答复: " gengdongjiu
  1 sibling, 1 reply; 4+ messages in thread
From: Greg KH @ 2018-06-15 10:40 UTC (permalink / raw)
  To: Dongjiu Geng
  Cc: mathias.nyman, thierry.reding, jonathanh, linux-usb, linux-tegra,
	linux-kernel

On Wed, Jun 06, 2018 at 10:36:59PM +0800, Dongjiu Geng wrote:
> Initialize the 'err' variate to remove the build warning,
> the warning is shown as below:
> 
> drivers/usb/host/xhci-tegra.c: In function 'tegra_xusb_mbox_thread':
> drivers/usb/host/xhci-tegra.c:552:6: warning: 'err' may be used uninitialized in this function [-Wuninitialized]
> drivers/usb/host/xhci-tegra.c:482:6: note: 'err' was declared here
> 
> Signed-off-by: Dongjiu Geng <gengdongjiu@huawei.com>
> Acked-by: Thierry Reding <treding@nvidia.com>
> ---
> How to reproduce:
> 1. make defconfig ARCH=arm
> 2. make -j100 CROSS_COMPILE=arm-linux-gnueabi- ARCH=arm
> 
> Then you can see below warnings:
> drivers/usb/host/xhci-tegra.c: In function 'tegra_xusb_mbox_thread':
> drivers/usb/host/xhci-tegra.c:552:6: warning: 'err' may be used uninitialized in this function [-Wuninitialized]
> drivers/usb/host/xhci-tegra.c:482:6: note: 'err' was declared here

What changed from v1?  Always put that below the --- line.

Please fix up and resend a v3.

thanks,

greg k-h

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

* 答复: [PATCH v2] usb: xhci: remove the code build warning
  2018-06-15 10:40 ` Greg KH
@ 2018-06-16  9:08   ` gengdongjiu
  0 siblings, 0 replies; 4+ messages in thread
From: gengdongjiu @ 2018-06-16  9:08 UTC (permalink / raw)
  To: Greg KH
  Cc: mathias.nyman, thierry.reding, jonathanh, linux-usb, linux-tegra,
	linux-kernel

> On Wed, Jun 06, 2018 at 10:36:59PM +0800, Dongjiu Geng wrote:
> > Initialize the 'err' variate to remove the build warning, the warning
> > is shown as below:
> >
> > drivers/usb/host/xhci-tegra.c: In function 'tegra_xusb_mbox_thread':
> > drivers/usb/host/xhci-tegra.c:552:6: warning: 'err' may be used
> > uninitialized in this function [-Wuninitialized]
> > drivers/usb/host/xhci-tegra.c:482:6: note: 'err' was declared here
> >
> > Signed-off-by: Dongjiu Geng <gengdongjiu@huawei.com>
> > Acked-by: Thierry Reding <treding@nvidia.com>
> > ---
> > How to reproduce:
> > 1. make defconfig ARCH=arm
> > 2. make -j100 CROSS_COMPILE=arm-linux-gnueabi- ARCH=arm
> >
> > Then you can see below warnings:
> > drivers/usb/host/xhci-tegra.c: In function 'tegra_xusb_mbox_thread':
> > drivers/usb/host/xhci-tegra.c:552:6: warning: 'err' may be used
> > uninitialized in this function [-Wuninitialized]
> > drivers/usb/host/xhci-tegra.c:482:6: note: 'err' was declared here
> 
> What changed from v1?  Always put that below the --- line.
> 
> Please fix up and resend a v3.


Thanks, I justly add "Acked-by: Thierry Reding <treding@nvidia.com>" in the V2 compared with v1
Anyway I will put that below and resend a v3.

> 
> thanks,
> 
> greg k-h

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

end of thread, other threads:[~2018-06-16  9:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-06 14:36 [PATCH v2] usb: xhci: remove the code build warning Dongjiu Geng
2018-06-11 12:30 ` gengdongjiu
2018-06-15 10:40 ` Greg KH
2018-06-16  9:08   ` 答复: " gengdongjiu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).