Re: [PATCH v2 12/13] usb/hcd-ehci: Remove redundant statements

2020-03-09 Thread Gerd Hoffmann
On Wed, Feb 26, 2020 at 04:46:46PM +0800, kuhn.chen...@huawei.com wrote:
> From: Chen Qun 
> 
> The "again" assignment is meaningless before g_assert_not_reached.
> In addition, the break statements no longer needs to be after
> g_assert_not_reached.
> 
> Clang static code analyzer show warning:
> hw/usb/hcd-ehci.c:2108:13: warning: Value stored to 'again' is never read
> again = -1;
> ^   ~~
> 
> Reported-by: Euler Robot 
> Signed-off-by: Chen Qun 
> Reviewed-by: Philippe Mathieu-Daudé 

Patch added to usb queue.

thanks,
  Gerd




[PATCH v2 12/13] usb/hcd-ehci: Remove redundant statements

2020-02-26 Thread kuhn.chenqun
From: Chen Qun 

The "again" assignment is meaningless before g_assert_not_reached.
In addition, the break statements no longer needs to be after
g_assert_not_reached.

Clang static code analyzer show warning:
hw/usb/hcd-ehci.c:2108:13: warning: Value stored to 'again' is never read
again = -1;
^   ~~

Reported-by: Euler Robot 
Signed-off-by: Chen Qun 
Reviewed-by: Philippe Mathieu-Daudé 
---
Cc: Gerd Hoffmann 
Cc: Philippe Mathieu-Daudé 
---
 hw/usb/hcd-ehci.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c
index 56ab2f457f..29d49c2d7e 100644
--- a/hw/usb/hcd-ehci.c
+++ b/hw/usb/hcd-ehci.c
@@ -1301,7 +1301,6 @@ static void ehci_execute_complete(EHCIQueue *q)
 /* should not be triggerable */
 fprintf(stderr, "USB invalid response %d\n", p->packet.status);
 g_assert_not_reached();
-break;
 }
 
 /* TODO check 4.12 for splits */
@@ -2105,9 +2104,7 @@ static void ehci_advance_state(EHCIState *ehci, int async)
 
 default:
 fprintf(stderr, "Bad state!\n");
-again = -1;
 g_assert_not_reached();
-break;
 }
 
 if (again < 0 || itd_count > 16) {
-- 
2.23.0