From: Arnd Bergmann <arnd@arndb.de>
To: David Laight <David.Laight@aculab.com>
Cc: Solomon Peachy <pizza@shaftnet.org>,
Kalle Valo <kvalo@codeaurora.org>,
Johannes Berg <johannes.berg@intel.com>,
"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] cw1200: fix bogus maybe-uninitialized warning
Date: Tue, 25 Oct 2016 22:19:49 +0200 [thread overview]
Message-ID: <14428343.0Jf5tZk0Ep@wuerfel> (raw)
In-Reply-To: <063D6719AE5E284EB5DD2968C1650D6DB0209E9A@AcuExch.aculab.com>
On Tuesday, October 25, 2016 1:24:55 PM CEST David Laight wrote:
> > 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!
> >
> > 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
prev parent reply other threads:[~2016-10-25 20:19 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-24 15:41 [PATCH] cw1200: fix bogus maybe-uninitialized warning Arnd Bergmann
[not found] ` <20161024154215.2863586-1-arnd-r2nGTMty4D4@public.gmane.org>
2016-10-25 13:24 ` David Laight
2016-10-25 18:13 ` Solomon Peachy
2016-10-25 20:19 ` Arnd Bergmann [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=14428343.0Jf5tZk0Ep@wuerfel \
--to=arnd@arndb.de \
--cc=David.Laight@aculab.com \
--cc=johannes.berg@intel.com \
--cc=kvalo@codeaurora.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pizza@shaftnet.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox