From: Sebastian Ott <sebott@linux.vnet.ibm.com>
To: Joe Perches <joe@perches.com>, Ursula Braun <ursula.braun@de.ibm.com>
Cc: Fabian Frederick <fabf@skynet.be>,
linux-kernel <linux-kernel@vger.kernel.org>,
akpm <akpm@linux-foundation.org>
Subject: Re: [PATCH 1/1] drivers/s390/cio/qdio_main.c: replace shift loop by ilog2
Date: Wed, 21 May 2014 14:32:27 +0200 (CEST) [thread overview]
Message-ID: <alpine.LFD.2.11.1405211418270.1579@denkbrett> (raw)
In-Reply-To: <1400604342.26709.2.camel@joe-AO725>
On Tue, 20 May 2014, Joe Perches wrote:
> On Tue, 2014-05-20 at 18:37 +0200, Fabian Frederick wrote:
> > This is untested.
> []
> > diff --git a/drivers/s390/cio/qdio_main.c b/drivers/s390/cio/qdio_main.c
> []
> > @@ -411,15 +411,14 @@ static inline void qdio_stop_polling(struct qdio_q *q)
> >
> > static inline void account_sbals(struct qdio_q *q, int count)
> > {
> > - int pos = 0;
> > + int pos;
> >
> > q->q_stats.nr_sbal_total += count;
> > if (count == QDIO_MAX_BUFFERS_MASK) {
> > q->q_stats.nr_sbals[7]++;
> > return;
> > }
> > - while (count >>= 1)
> > - pos++;
> > + pos = ilog2(count);
>
> What guarantees count > 0 here?
We would already be screwed when called with count < 0. Ursula, do the
callers assure that count is positive?
Regards,
Sebastian
>
> count may be better unsigned.
>
>
next prev parent reply other threads:[~2014-05-21 12:32 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-20 16:37 [PATCH 1/1] drivers/s390/cio/qdio_main.c: replace shift loop by ilog2 Fabian Frederick
2014-05-20 16:45 ` Joe Perches
2014-05-21 12:32 ` Sebastian Ott [this message]
2014-06-02 14:41 ` Sebastian Ott
2014-06-02 18:17 ` Fabian Frederick
2014-06-03 7:41 ` Sebastian Ott
[not found] <OF57E68FFD.38663B1A-ONC1257CE0.00383C6B-C1257CE0.0038457A@de.ibm.com>
2014-05-22 10:22 ` Ursula Braun
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=alpine.LFD.2.11.1405211418270.1579@denkbrett \
--to=sebott@linux.vnet.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=fabf@skynet.be \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=ursula.braun@de.ibm.com \
/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