All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] usb: cdns3: fix static checker warning.
@ 2021-03-10 16:01 ` Frank Li
  0 siblings, 0 replies; 4+ messages in thread
From: Frank Li @ 2021-03-10 16:01 UTC (permalink / raw)
  To: peter.chen, pawell, a-govindraju, linux-imx, linux-usb,
	linux-arm-kernel, lznuaa, dan.carpenter

The patch c450e48eb570: "usb: cdns3: add power lost support for
system resume" from Feb 18, 2021, leads to the following static
checker warning:

        drivers/usb/cdns3/core.c:551 cdns_resume()
        error: uninitialized symbol 'ret'.

drivers/usb/cdns3/core.c
544
545     if (!role_changed) {
546            if (cdns->role == USB_ROLE_HOST)
547                  ret = cdns_drd_host_on(cdns);
548     else if (cdns->role == USB_ROLE_DEVICE)
549            ret = cdns_drd_gadget_on(cdns);

"ret" is uninitialized at else branch.

Signed-off-by: Frank Li <Frank.Li@nxp.com>
---
 drivers/usb/cdns3/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/cdns3/core.c b/drivers/usb/cdns3/core.c
index 5d486c8a9d99..bb739d88179f 100644
--- a/drivers/usb/cdns3/core.c
+++ b/drivers/usb/cdns3/core.c
@@ -527,7 +527,7 @@ int cdns_resume(struct cdns *cdns, u8 set_active)
 	struct device *dev = cdns->dev;
 	enum usb_role real_role;
 	bool role_changed = false;
-	int ret;
+	int ret = 0;
 
 	if (cdns_power_is_lost(cdns)) {
 		if (cdns->role_sw) {
-- 
2.25.1


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

* [PATCH 1/1] usb: cdns3: fix static checker warning.
@ 2021-03-10 16:01 ` Frank Li
  0 siblings, 0 replies; 4+ messages in thread
From: Frank Li @ 2021-03-10 16:01 UTC (permalink / raw)
  To: peter.chen, pawell, a-govindraju, linux-imx, linux-usb,
	linux-arm-kernel, lznuaa, dan.carpenter

The patch c450e48eb570: "usb: cdns3: add power lost support for
system resume" from Feb 18, 2021, leads to the following static
checker warning:

        drivers/usb/cdns3/core.c:551 cdns_resume()
        error: uninitialized symbol 'ret'.

drivers/usb/cdns3/core.c
544
545     if (!role_changed) {
546            if (cdns->role == USB_ROLE_HOST)
547                  ret = cdns_drd_host_on(cdns);
548     else if (cdns->role == USB_ROLE_DEVICE)
549            ret = cdns_drd_gadget_on(cdns);

"ret" is uninitialized at else branch.

Signed-off-by: Frank Li <Frank.Li@nxp.com>
---
 drivers/usb/cdns3/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/cdns3/core.c b/drivers/usb/cdns3/core.c
index 5d486c8a9d99..bb739d88179f 100644
--- a/drivers/usb/cdns3/core.c
+++ b/drivers/usb/cdns3/core.c
@@ -527,7 +527,7 @@ int cdns_resume(struct cdns *cdns, u8 set_active)
 	struct device *dev = cdns->dev;
 	enum usb_role real_role;
 	bool role_changed = false;
-	int ret;
+	int ret = 0;
 
 	if (cdns_power_is_lost(cdns)) {
 		if (cdns->role_sw) {
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 1/1] usb: cdns3: fix static checker warning.
  2021-03-10 16:01 ` Frank Li
@ 2021-03-13 13:55   ` Peter Chen
  -1 siblings, 0 replies; 4+ messages in thread
From: Peter Chen @ 2021-03-13 13:55 UTC (permalink / raw)
  To: Frank Li
  Cc: pawell, a-govindraju, linux-imx, linux-usb, linux-arm-kernel,
	dan.carpenter

On 21-03-10 10:01:25, Frank Li wrote:
> The patch c450e48eb570: "usb: cdns3: add power lost support for
> system resume" from Feb 18, 2021, leads to the following static
> checker warning:
> 
>         drivers/usb/cdns3/core.c:551 cdns_resume()
>         error: uninitialized symbol 'ret'.
> 
> drivers/usb/cdns3/core.c
> 544
> 545     if (!role_changed) {
> 546            if (cdns->role == USB_ROLE_HOST)
> 547                  ret = cdns_drd_host_on(cdns);
> 548     else if (cdns->role == USB_ROLE_DEVICE)
> 549            ret = cdns_drd_gadget_on(cdns);
> 
> "ret" is uninitialized at else branch.
> 
> Signed-off-by: Frank Li <Frank.Li@nxp.com>
> ---
>  drivers/usb/cdns3/core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/cdns3/core.c b/drivers/usb/cdns3/core.c
> index 5d486c8a9d99..bb739d88179f 100644
> --- a/drivers/usb/cdns3/core.c
> +++ b/drivers/usb/cdns3/core.c
> @@ -527,7 +527,7 @@ int cdns_resume(struct cdns *cdns, u8 set_active)
>  	struct device *dev = cdns->dev;
>  	enum usb_role real_role;
>  	bool role_changed = false;
> -	int ret;
> +	int ret = 0;
>  
>  	if (cdns_power_is_lost(cdns)) {
>  		if (cdns->role_sw) {
> -- 
> 2.25.1
> 

Hi Frank,

If this issue is reported by Dan, you may add his reported-by tag.
Besides, please keep your signed-of-by tag as the same with your patch
author. I fixed both, you do not need to re-send.

-- 

Thanks,
Peter Chen


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

* Re: [PATCH 1/1] usb: cdns3: fix static checker warning.
@ 2021-03-13 13:55   ` Peter Chen
  0 siblings, 0 replies; 4+ messages in thread
From: Peter Chen @ 2021-03-13 13:55 UTC (permalink / raw)
  To: Frank Li
  Cc: pawell, a-govindraju, linux-imx, linux-usb, linux-arm-kernel,
	dan.carpenter

On 21-03-10 10:01:25, Frank Li wrote:
> The patch c450e48eb570: "usb: cdns3: add power lost support for
> system resume" from Feb 18, 2021, leads to the following static
> checker warning:
> 
>         drivers/usb/cdns3/core.c:551 cdns_resume()
>         error: uninitialized symbol 'ret'.
> 
> drivers/usb/cdns3/core.c
> 544
> 545     if (!role_changed) {
> 546            if (cdns->role == USB_ROLE_HOST)
> 547                  ret = cdns_drd_host_on(cdns);
> 548     else if (cdns->role == USB_ROLE_DEVICE)
> 549            ret = cdns_drd_gadget_on(cdns);
> 
> "ret" is uninitialized at else branch.
> 
> Signed-off-by: Frank Li <Frank.Li@nxp.com>
> ---
>  drivers/usb/cdns3/core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/cdns3/core.c b/drivers/usb/cdns3/core.c
> index 5d486c8a9d99..bb739d88179f 100644
> --- a/drivers/usb/cdns3/core.c
> +++ b/drivers/usb/cdns3/core.c
> @@ -527,7 +527,7 @@ int cdns_resume(struct cdns *cdns, u8 set_active)
>  	struct device *dev = cdns->dev;
>  	enum usb_role real_role;
>  	bool role_changed = false;
> -	int ret;
> +	int ret = 0;
>  
>  	if (cdns_power_is_lost(cdns)) {
>  		if (cdns->role_sw) {
> -- 
> 2.25.1
> 

Hi Frank,

If this issue is reported by Dan, you may add his reported-by tag.
Besides, please keep your signed-of-by tag as the same with your patch
author. I fixed both, you do not need to re-send.

-- 

Thanks,
Peter Chen


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2021-03-13 13:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-10 16:01 [PATCH 1/1] usb: cdns3: fix static checker warning Frank Li
2021-03-10 16:01 ` Frank Li
2021-03-13 13:55 ` Peter Chen
2021-03-13 13:55   ` Peter Chen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.