+ iommu-common-do-not-use-64-bit-constant-0xffffffffffffffffl-for-computing-align_mask.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: lib/iommu-common.c: do not use 0xffffffffffffffffl for computing align_mask
has been added to the -mm tree.  Its filename is
     iommu-common-do-not-use-64-bit-constant-0xffffffffffffffffl-for-computing-align_mask.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/iommu-common-do-not-use-64-bit-constant-0xffffffffffffffffl-for-computing-align_mask.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/iommu-common-do-not-use-64-bit-constant-0xffffffffffffffffl-for-computing-align_mask.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Sowmini Varadhan <sowmini.varadhan@xxxxxxxxxx>
Subject: lib/iommu-common.c: do not use 0xffffffffffffffffl for computing align_mask

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@xxxxxxxxxx>
Cc: Benjamin Herrenschmidt <benh@xxxxxxxxxxxxxxxxxxx>
Cc: David S. Miller <davem@xxxxxxxxxxxxx>
Cc: Guenter Roeck <linux@xxxxxxxxxxxx>
Cc: Rasmus Villemoes <linux@xxxxxxxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 lib/iommu-common.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN lib/iommu-common.c~iommu-common-do-not-use-64-bit-constant-0xffffffffffffffffl-for-computing-align_mask lib/iommu-common.c
--- a/lib/iommu-common.c~iommu-common-do-not-use-64-bit-constant-0xffffffffffffffffl-for-computing-align_mask
+++ a/lib/iommu-common.c
@@ -119,7 +119,7 @@ unsigned long iommu_tbl_range_alloc(stru
 	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)) {
_

Patches currently in -mm which might be from sowmini.varadhan@xxxxxxxxxx are

iommu-common-do-not-use-64-bit-constant-0xffffffffffffffffl-for-computing-align_mask.patch
linux-next.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux