linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iommu-common: Do not use 64 bit  constant 0xffffffffffffffffl for computing align_mask
@ 2015-07-19 12:20 Sowmini Varadhan
  2015-07-19 15:27 ` Guenter Roeck
  0 siblings, 1 reply; 10+ messages in thread
From: Sowmini Varadhan @ 2015-07-19 12:20 UTC (permalink / raw)
  To: linux-kernel; +Cc: akpm, sowmini.varadhan, linux, benh, davem


Using a 64 bit constant generates "warning: integer constant is too
large for 'long' type" on 32 bit platforms. Instead use ~0l to get
the desired effect.

Detected by Andrew Morton who has confirmed that this patch
fixes the warning on i386/gcc-4.4.3, i386/gcc-4.4.0 and arm/gcc-4.4.4.

Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
---
 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..fd1297d 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 = ~0l >> (64 - align_order);
 
 	/* Sanity check */
 	if (unlikely(npages == 0)) {
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2015-07-21  0:26 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-19 12:20 [PATCH] iommu-common: Do not use 64 bit constant 0xffffffffffffffffl for computing align_mask Sowmini Varadhan
2015-07-19 15:27 ` Guenter Roeck
2015-07-19 20:25   ` Rasmus Villemoes
2015-07-19 20:41     ` Sowmini Varadhan
2015-07-20  1:58     ` Guenter Roeck
2015-07-20 17:57       ` Rasmus Villemoes
2015-07-20 19:25         ` Sowmini Varadhan
2015-07-20 23:28         ` Andrew Morton
2015-07-21  0:26           ` Guenter Roeck
2015-07-20 14:44   ` Sowmini Varadhan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).