Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755625AbbGUUDO (ORCPT ); Tue, 21 Jul 2015 16:03:14 -0400 Received: from bh-25.webhostbox.net ([208.91.199.152]:57095 "EHLO bh-25.webhostbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754802AbbGUT7k (ORCPT ); Tue, 21 Jul 2015 15:59:40 -0400 Date: Tue, 21 Jul 2015 12:59:32 -0700 From: Guenter Roeck To: Sowmini Varadhan Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org, benh@kernel.crashing.org, davem@davemloft.net, linux@rasmusvillemoes.dk Subject: Re: [PATCH v2] iommu-common: Do not use 64 bit constant 0xffffffffffffffffl for computing align_mask Message-ID: <20150721195932.GA19668@roeck-us.net> References: <20150721044941.GA24786@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150721044941.GA24786@oracle.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Authenticated_sender: guenter@roeck-us.net X-OutGoing-Spam-Status: No, score=-1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bh-25.webhostbox.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - roeck-us.net X-Get-Message-Sender-Via: bh-25.webhostbox.net: authenticated_id: guenter@roeck-us.net X-Source: X-Source-Args: X-Source-Dir: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1277 Lines: 40 On Tue, Jul 21, 2015 at 06:49:41AM +0200, Sowmini Varadhan wrote: > 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 Looks ok afaics. Reviewed-by: Guenter Roeck > --- > 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 > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/