From patchwork Mon Sep 8 14:31:38 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Richter X-Patchwork-Id: 4862931 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0B9F79F32F for ; Mon, 8 Sep 2014 14:34:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C4D732012F for ; Mon, 8 Sep 2014 14:33:59 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7E27D20117 for ; Mon, 8 Sep 2014 14:33:58 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XQzzD-0008HT-Es; Mon, 08 Sep 2014 14:32:07 +0000 Received: from mail-we0-x22c.google.com ([2a00:1450:400c:c03::22c]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XQzzA-00086k-AR for linux-arm-kernel@lists.infradead.org; Mon, 08 Sep 2014 14:32:04 +0000 Received: by mail-we0-f172.google.com with SMTP id k48so36748wev.3 for ; Mon, 08 Sep 2014 07:31:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=mEWmpSwLiZ+vt+FoU/98w3nAF6J0NoZ6ZM22I1+OeQc=; b=U7MmnGrGvYEAOmFJEdnav/V5E2vXqdI7AdqLbGYfVx/Vglqn1ldLwsQIeqQMYZCoBN 5J5O1DJRh+o4KAnGNuwSSN/VIp/+JETWulL1CWjL5aVsHFU29CdH7ZpbLqlrO4F4BMKg PQgBtxPn/OCm6Ab45OEpp/Q7hpsovOsAywzhoA2vGxWj4xx+zZ1d2Bju3XJRbIDaN86I toHoJc1DXZHrWImOBu0CsAGar23/9CKI2G71z2xrZNMyvyNmcEpZqSaWGvaL/RVnC/lc 0fQkbkvCQ1NXXlL3miljvGbSG3xGoE1TjvxOwqkQ3DK7NW6WyHK8dGo418nOm37dxaY2 oWkw== X-Received: by 10.180.19.103 with SMTP id d7mr23828033wie.9.1410186701688; Mon, 08 Sep 2014 07:31:41 -0700 (PDT) Received: from rric.localhost (f053085086.adsl.alicedsl.de. [78.53.85.86]) by mx.google.com with ESMTPSA id o3sm11938337wiy.18.2014.09.08.07.31.40 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 08 Sep 2014 07:31:41 -0700 (PDT) Date: Mon, 8 Sep 2014 16:31:38 +0200 From: Robert Richter To: Marc Zyngier Subject: [PATCH] ITS: Fixing 32 bit compatibility Message-ID: <20140908143138.GZ4703@rric.localhost> References: <1410185480-5153-1-git-send-email-rric@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1410185480-5153-1-git-send-email-rric@kernel.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140908_073204_517067_111F4C15 X-CRM114-Status: GOOD ( 14.40 ) X-Spam-Score: -0.7 (/) Cc: Robert Richter , Thomas Gleixner , Jason Cooper , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Marc, On 08.09.14 16:11:19, Robert Richter wrote: > From: Robert Richter > > Fixing 32 bit compatibility by using ULL for u64 constants. the same is true for gicv3-its (branch 'gicv3/its' of git://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms). See the patch below. You may merge the fixes with your patches or apply it on top of yours. -Robert From 38a71030b9b93a14afada6979c709f6addac5112 Mon Sep 17 00:00:00 2001 From: Robert Richter Date: Tue, 26 Aug 2014 18:08:56 +0200 Subject: [PATCH] ITS: Fixing 32 bit compatibility Fixing 32 bit compatibility by using ULL for u64 constants. Signed-off-by: Robert Richter --- drivers/irqchip/irq-gic-v3-its.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c index 26927521fc28..2fda6935ad32 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c @@ -173,55 +173,55 @@ static struct rdist *gic_rdist; static void its_encode_cmd(struct its_cmd_block *cmd, u8 cmd_nr) { - cmd->raw_cmd[0] &= ~0xffUL; + cmd->raw_cmd[0] &= ~0xffULL; cmd->raw_cmd[0] |= cmd_nr; } static void its_encode_devid(struct its_cmd_block *cmd, u32 devid) { - cmd->raw_cmd[0] &= 0xffffffffUL; + cmd->raw_cmd[0] &= 0xffffffffULL; cmd->raw_cmd[0] |= ((u64)devid) << 32; } static void its_encode_event_id(struct its_cmd_block *cmd, u32 id) { - cmd->raw_cmd[1] &= ~0xffffffffUL; + cmd->raw_cmd[1] &= ~0xffffffffULL; cmd->raw_cmd[1] |= id; } static void its_encode_phys_id(struct its_cmd_block *cmd, u32 phys_id) { - cmd->raw_cmd[1] &= 0xffffffffUL; + cmd->raw_cmd[1] &= 0xffffffffULL; cmd->raw_cmd[1] |= ((u64)phys_id) << 32; } static void its_encode_size(struct its_cmd_block *cmd, u8 size) { - cmd->raw_cmd[1] &= ~0xffUL; - cmd->raw_cmd[1] |= size & 0xff; + cmd->raw_cmd[1] &= ~0xffULL; + cmd->raw_cmd[1] |= size; } static void its_encode_itt(struct its_cmd_block *cmd, u64 itt_addr) { - cmd->raw_cmd[2] &= ~0xffffffffffffUL; - cmd->raw_cmd[2] |= itt_addr & 0xffffffffff00UL; + cmd->raw_cmd[2] &= ~0xffffffffffffULL; + cmd->raw_cmd[2] |= itt_addr & 0xffffffffff00ULL; } static void its_encode_valid(struct its_cmd_block *cmd, int valid) { - cmd->raw_cmd[2] &= ~(1UL << 63); + cmd->raw_cmd[2] &= ~(1ULL << 63); cmd->raw_cmd[2] |= ((u64)!!valid) << 63; } static void its_encode_target(struct its_cmd_block *cmd, u64 target_addr) { - cmd->raw_cmd[2] &= ~(0xffffffffUL << 16); - cmd->raw_cmd[2] |= (target_addr & (0xffffffffUL << 16)); + cmd->raw_cmd[2] &= ~(0xffffffffULL << 16); + cmd->raw_cmd[2] |= (target_addr & (0xffffffffULL << 16)); } static void its_encode_collection(struct its_cmd_block *cmd, u16 col) { - cmd->raw_cmd[2] &= ~0xffffUL; + cmd->raw_cmd[2] &= ~0xffffULL; cmd->raw_cmd[2] |= col; } @@ -1221,8 +1221,8 @@ static int its_msi_setup_irq(struct msi_chip *chip, addr = its->phys_base + GITS_TRANSLATER; - msg.address_lo = addr & ((1UL << 32) - 1); - msg.address_hi = addr >> 32; + msg.address_lo = (u32)addr; + msg.address_hi = (u32)(addr >> 32); msg.data = vec_nr; write_msi_msg(irq, &msg);