From patchwork Thu Jul 20 15:45:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9855223 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3C669602BA for ; Thu, 20 Jul 2017 15:52:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2CC46286B2 for ; Thu, 20 Jul 2017 15:52:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 21AE7286D6; Thu, 20 Jul 2017 15:52:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B0929286B2 for ; Thu, 20 Jul 2017 15:52:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=qQRr/AJXPybHRagiaecAs1ZYRx559ocAvMgNAueRrVk=; b=o4mIsXAArHnemjQMDx4dv12j6r IJLiR9bwnhEtdC4BNGrLuukrYewHVdHtQ0XQBkra5D9ukQdqKxCCQi1roeqw9Mq6uLtZJZ7AeLU48 eQpk31Fw2TKRxBxA3R4CQZHz2RWMMU37Dr+1W66GZVAOJGLLwZQsQXun7cgJx3m06nTPZtgt34Y7Z c4N0n0ZZFZJKaBYSc2wxmNQvwuF0omHR63qeTifazSxwfLpbGFEyBuCvi8B84Cq8YAa2TN2kvevRq J0e7Zv1rDs7kag1fYyw0FdUBdLzm+MdeQsplk+cBiiMA4rBL3OZ80vCIDvlKePivpZQVAHpGY+pyA ahQjFbqQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dYDko-000053-5b; Thu, 20 Jul 2017 15:52:42 +0000 Received: from mout.kundenserver.de ([212.227.17.24]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dYDkk-0008C1-In for linux-arm-kernel@lists.infradead.org; Thu, 20 Jul 2017 15:52:40 +0000 Received: from wuerfel.lan ([5.56.224.194]) by mrelayeu.kundenserver.de (mreue101 [212.227.15.145]) with ESMTPA (Nemesis) id 0MX0aK-1d4TQI1JkC-00W1g5; Thu, 20 Jul 2017 17:47:02 +0200 From: Arnd Bergmann To: Imre Kaloz , Krzysztof Halasa Subject: [PATCH 01/12] ARM: ixp4xx: fix ioport_unmap definition Date: Thu, 20 Jul 2017 17:45:55 +0200 Message-Id: <20170720154616.3250481-2-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170720154616.3250481-1-arnd@arndb.de> References: <20170720154616.3250481-1-arnd@arndb.de> X-Provags-ID: V03:K0:jZbP+XXynauxDRHgRvTD+GeNJUzkNh2Vlwp6kbVtKFT4pcQ9zZB PoYX+hmEXVU69cNGLHAcyOHASVT83q2j91fYl2vD69ldHUlmB1V/5lHt9rMvj0hmaugYF6k NUmX1Q6fZRvsiNGwSwQMnyfbA3fz+J8yW4oSadhEWu+yR8k6Jy2FaqgrLwuDEa2PAJ0Tyl3 jxy4ERTidEV3eSrgH8wag== X-UI-Out-Filterresults: notjunk:1; V01:K0:VpdaaOSr92g=:vBeLF/5nP9UvCM3fknfx3a 6Zlv2pa7hQ5idBhZuQwGDF5GYItKlDsC8/vi2yFLAooejOkltdUgvPCBVHUpYAU2cgfiJHx+T jgc3xNmVZovLBSinQScX5b9ARjCCnTtTX2pG3r1AtoxWCaoJT0onEZ/TW9wxsq16WRczzpdgJ ejyF2ZILm3vTQgYTOWrAKKMKNVyvvOzjUAHy514HdXdzwYKR7RNS01yA+Lq2ZRfma6vsHS9vB ajZ85s6uf1C9p5e9up8dCzu5nvl4oibNwZBoqbQmCgn9tKLBmAJ4ZLhn2ZmTKTOBQtQJbTXW3 v78m16X+4X2nU5h/LrdcenH29Bbsm3QFFOCs+6v964qREJ638qifOUvfvPLoSpmMMlbnXZXVo e2NDfnI2WVWBJDYW36m2+7qFSJgu6kENCPzGEZL5zQKYIG3Zh6mZHO2sS/4nRpRuYY4sqUJ+b bwH3eioVkUNIZ/Yk7AkCQB/nGe1nN1ptRC40wDaMEE7cdfyllJG4pYCISENqv8TSVWMNDxjuL PtdL8xzj0icVCgCpAOpzLFYt5N88ByK2x+dqoRSgvkMUzQXbbsfuopggR0IAkcfq5o68WxiWY MpVmmHumjWjbUNWVHgd4K8sZuuIRHcaNOf4ru3a0RpJ/QzLn+JK1m4rAitcyfS+kQRu5kmOvY BHwUN64iy3YDJMKVYrKRYLxYtBaRv7SVRkjpGm2ru2uhpx/eN0Sz60jiKZa/joGSvfYxDhnRB ktiizQap4aERFk6QhFF7iFDme5AknZWVfT4NCg== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170720_085239_006790_021E2EAD X-CRM114-Status: UNSURE ( 9.81 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-kernel@lists.infradead.org, Arnd Bergmann , linux-kernel@vger.kernel.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP An empty macro definition can cause unexpected behavior, in case of the ixp4xx ioport_unmap, we get two warnings: drivers/net/wireless/marvell/libertas/if_cs.c: In function 'if_cs_release': drivers/net/wireless/marvell/libertas/if_cs.c:826:3: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body] ioport_unmap(card->iobase); drivers/vfio/pci/vfio_pci_rdwr.c: In function 'vfio_pci_vga_rw': drivers/vfio/pci/vfio_pci_rdwr.c:230:15: error: the omitted middle operand in ?: will always be 'true', suggest explicit middle operand [-Werror=parentheses] is_ioport ? ioport_unmap(iomem) : iounmap(iomem); This uses an inline function to define the macro in a safer way. Signed-off-by: Arnd Bergmann Acked-by: Krzysztof Halasa --- arch/arm/mach-ixp4xx/include/mach/io.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-ixp4xx/include/mach/io.h b/arch/arm/mach-ixp4xx/include/mach/io.h index 7a0c13bf4269..2f84c26a6758 100644 --- a/arch/arm/mach-ixp4xx/include/mach/io.h +++ b/arch/arm/mach-ixp4xx/include/mach/io.h @@ -523,8 +523,15 @@ static inline void iowrite32_rep(void __iomem *addr, const void *vaddr, #endif } -#define ioport_map(port, nr) ((void __iomem*)(port + PIO_OFFSET)) -#define ioport_unmap(addr) +#define ioport_map(port, nr) ioport_map(port, nr) +static inline void __iomem *ioport_map(unsigned long port, unsigned int nr) +{ + return ((void __iomem*)((port) + PIO_OFFSET)); +} +#define ioport_unmap(addr) ioport_unmap(addr) +static inline void ioport_unmap(void __iomem *addr) +{ +} #endif /* CONFIG_PCI */ #endif /* __ASM_ARM_ARCH_IO_H */