From: Roland Dreier <rdreier@cisco.com>
To: Jeff Garzik <jeff@garzik.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: whole bunch o' new IB warnings
Date: Wed, 13 Jun 2007 13:53:41 -0700 [thread overview]
Message-ID: <adaejkf4luy.fsf@cisco.com> (raw)
In-Reply-To: <4670568A.7030809@garzik.org> (Jeff Garzik's message of "Wed, 13 Jun 2007 16:41:46 -0400")
> Current git tree on x86-64 (make allmodconfig) wants fixing for 2.6.22:
>
> drivers/infiniband/hw/mlx4/qp.c: In function set_rq_size:
> drivers/infiniband/hw/mlx4/qp.c:210: warning: comparison of distinct
> pointer types lacks a cast
Thanks, you're right. You have to admit, it's pretty amusing how many
times roundup_pow_of_two() expands its argument (via ilog2)...
Anyway, I have this queued up to fix it. I'll ask Linus to pull shortly.
commit 42c059ea2b0aac5f961253ba81c1b464d181a600
Author: Roland Dreier <rolandd@cisco.com>
Date: Tue Jun 12 10:52:02 2007 -0700
IB/mlx4: Fix warning in rounding up queue sizes
Doing max(1, foo) where foo is u32 generates a warning, because 1 is a
signed constant. Fix this by using 1U instead.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
diff --git a/drivers/infiniband/hw/mlx4/qp.c b/drivers/infiniband/hw/mlx4/qp.c
index 5c6d054..4c15fa3 100644
--- a/drivers/infiniband/hw/mlx4/qp.c
+++ b/drivers/infiniband/hw/mlx4/qp.c
@@ -207,8 +207,8 @@ static int set_rq_size(struct mlx4_ib_dev *dev, struct ib_qp_cap *cap,
if (is_user && (!cap->max_recv_wr || !cap->max_recv_sge))
return -EINVAL;
- qp->rq.max = roundup_pow_of_two(max(1, cap->max_recv_wr));
- qp->rq.max_gs = roundup_pow_of_two(max(1, cap->max_recv_sge));
+ qp->rq.max = roundup_pow_of_two(max(1U, cap->max_recv_wr));
+ qp->rq.max_gs = roundup_pow_of_two(max(1U, cap->max_recv_sge));
qp->rq.wqe_shift = ilog2(qp->rq.max_gs * sizeof (struct mlx4_wqe_data_seg));
}
prev parent reply other threads:[~2007-06-13 20:53 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-13 20:41 whole bunch o' new IB warnings Jeff Garzik
2007-06-13 20:53 ` Roland Dreier [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=adaejkf4luy.fsf@cisco.com \
--to=rdreier@cisco.com \
--cc=akpm@linux-foundation.org \
--cc=jeff@garzik.org \
--cc=linux-kernel@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.