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: 108390 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp2301119qge; Thu, 20 Jul 2017 08:47:09 -0700 (PDT) X-Received: by 10.84.137.1 with SMTP id 1mr4671234plm.75.1500565629483; Thu, 20 Jul 2017 08:47:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500565629; cv=none; d=google.com; s=arc-20160816; b=h0N7F5Xe89sf4pRX6sJVR61UA+UeVbmFNPhJi5Yo3XFOAnRAkAO4H5E8fzaZkFulbd iOObPSMRO4iLVAy4ZZRED7VSKohnP6bsY5j33GvAEqCdhzAxQUwPDcCappk3gYe8X+7P a02nJXOBmvxjGTYtw3i+D1UKRC1mZpeVAHyWsKAfhHZ+Sj8mROUOctRuN/71vt17JKVn g24vTqSMjPD2XinG9zfi3o0WLh9aEIP7nv2Q+E4+rWQb/Ly1Ohk/Fvdyz3aAnNDXSRra 1cpEsPlBIJHIxYVmf3mR+boy9ScuQjW2cEIf87jMGt1LMmZW+h0Uu6iMVhBXJXWjKOgZ 7+Ew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=lhMOyZxiEsfOQcGrpwCj6mb3xwtqzN7ZxEJwB6+HW7g=; b=BZf6Bx4Z81XXfb6jxPJ2ypI8OSre0K86LXjrXIxSkCe5cCWjaCkZFDNMje/dvN0rc8 bz25iXHG3Y7ozW+bC5Pmwz4t4w+8fLAdw4WUAVCpylDidC6TJyN+EP1ei9EA2Kb1Vb/i +56599YM4BXEnwDyApwwvYQIls2anoo71TwhwqAYISOijs9yR3s+ltyze8bv4m1tTeP1 bVf0v4rxB08vRU6AqeHixByLrHHipVRpj88fiK1pbFCPqoCj6tATe8KxgG2eiHW/1gHu obxnWYS65lDd3+Vl4aVfy7SR4D6w+V+PE91UQBqmr3QDqRbm2jO2ee6n+cPuFCkfvaXB 17Uw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o17si1711063pli.542.2017.07.20.08.47.09; Thu, 20 Jul 2017 08:47:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965554AbdGTPrH (ORCPT + 25 others); Thu, 20 Jul 2017 11:47:07 -0400 Received: from mout.kundenserver.de ([217.72.192.74]:56705 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934781AbdGTPrF (ORCPT ); Thu, 20 Jul 2017 11:47:05 -0400 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 Cc: Arnd Bergmann , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org 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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zHPynW4Sq2svtBJ96vR/w== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- arch/arm/mach-ixp4xx/include/mach/io.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) -- 2.9.0 Acked-by: Krzysztof Halasa 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 */