Thread (4 messages) 4 messages, 3 authors, 2016-10-25

Re: [PATCH] cw1200: fix bogus maybe-uninitialized warning

From: Arnd Bergmann <arnd@arndb.de>
Date: 2016-10-25 20:20:27
Also in: lkml, netdev

On Tuesday, October 25, 2016 1:24:55 PM CEST David Laight wrote:
quoted
diff --git a/drivers/net/wireless/st/cw1200/wsm.c b/drivers/net/wireless/st/cw1200/wsm.c
index 680d60eabc75..094e6637ade2 100644
--- a/drivers/net/wireless/st/cw1200/wsm.c
+++ b/drivers/net/wireless/st/cw1200/wsm.c
@@ -385,14 +385,13 @@ static int wsm_multi_tx_confirm(struct cw1200_common *priv,
      if (WARN_ON(count <= 0))
              return -EINVAL;

-     if (count > 1) {
-             /* We already released one buffer, now for the rest */
-             ret = wsm_release_tx_buffer(priv, count - 1);
-             if (ret < 0)
-                     return ret;
-             else if (ret > 0)
-                     cw1200_bh_wakeup(priv);
-     }
+     /* We already released one buffer, now for the rest */
+     ret = wsm_release_tx_buffer(priv, count - 1);
+     if (ret < 0)
+             return ret;
+
+     if (ret > 0)
+             cw1200_bh_wakeup(priv);
That doesn't look equivalent to me (when count == 1).
Ah, that's what I missed, thanks for pointing that out!
quoted
      cw1200_debug_txed_multi(priv, count);
      for (i = 0; i < count; ++i) {
Convert this loop into a do ... while so the body executes at least once.
Good idea. Version 2 coming now.

	Arnd
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help