From: Sowmini Varadhan <sowmini.varadhan@oracle.com>
To: linux-kernel@vger.kernel.org
Cc: akpm@linux-foundation.org, benh@kernel.crashing.org,
davem@davemloft.net, linux@roeck-us.net,
linux@rasmusvillemoes.dk, sowmini.varadhan@oracle.com
Subject: [PATCH v2] iommu-common: Do not use 64 bit constant 0xffffffffffffffffl for computing align_mask
Date: Tue, 21 Jul 2015 06:49:41 +0200 [thread overview]
Message-ID: <20150721044941.GA24786@oracle.com> (raw)
Using a 64 bit constant generates "warning: integer constant is too
large for 'long' type" on 32 bit platforms. Instead use ~0ul and
BITS_PER_LONG.
Detected by Andrew Morton on ARMD.
Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
---
v2: use BITS_PER_LONG and ulong as discussed on mailing list.
lib/iommu-common.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/iommu-common.c b/lib/iommu-common.c
index df30632..ff19f66 100644
--- a/lib/iommu-common.c
+++ b/lib/iommu-common.c
@@ -119,7 +119,7 @@ unsigned long iommu_tbl_range_alloc(struct device *dev,
unsigned long align_mask = 0;
if (align_order > 0)
- align_mask = 0xffffffffffffffffl >> (64 - align_order);
+ align_mask = ~0ul >> (BITS_PER_LONG - align_order);
/* Sanity check */
if (unlikely(npages == 0)) {
--
1.7.1
next reply other threads:[~2015-07-21 4:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-21 4:49 Sowmini Varadhan [this message]
2015-07-21 19:59 ` [PATCH v2] iommu-common: Do not use 64 bit constant 0xffffffffffffffffl for computing align_mask Guenter Roeck
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=20150721044941.GA24786@oracle.com \
--to=sowmini.varadhan@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=benh@kernel.crashing.org \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@rasmusvillemoes.dk \
--cc=linux@roeck-us.net \
/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.