Commit 92bdae5d authored by Fabian Frederick's avatar Fabian Frederick Committed by Martin Schwidefsky

s390/qdio: replace shift loop by ilog2

account_sbals is called by get_inbound_buffer_frontier and
get_outbound_buffer_frontier with 'count' value > 0 so we can safely
convert shift loop to ilog2.

Cc: Joe Perches <joe@perches.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarFabian Frederick <fabf@skynet.be>
Signed-off-by: default avatarSebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent dbe33fc9
...@@ -409,17 +409,16 @@ static inline void qdio_stop_polling(struct qdio_q *q) ...@@ -409,17 +409,16 @@ static inline void qdio_stop_polling(struct qdio_q *q)
set_buf_state(q, q->u.in.ack_start, SLSB_P_INPUT_NOT_INIT); set_buf_state(q, q->u.in.ack_start, SLSB_P_INPUT_NOT_INIT);
} }
static inline void account_sbals(struct qdio_q *q, int count) static inline void account_sbals(struct qdio_q *q, unsigned int count)
{ {
int pos = 0; int pos;
q->q_stats.nr_sbal_total += count; q->q_stats.nr_sbal_total += count;
if (count == QDIO_MAX_BUFFERS_MASK) { if (count == QDIO_MAX_BUFFERS_MASK) {
q->q_stats.nr_sbals[7]++; q->q_stats.nr_sbals[7]++;
return; return;
} }
while (count >>= 1) pos = ilog2(count);
pos++;
q->q_stats.nr_sbals[pos]++; q->q_stats.nr_sbals[pos]++;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment