From patchwork Fri Jun 8 09:48:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 926659 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 412Hrt747Qz9s0W for ; Fri, 8 Jun 2018 19:57:34 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux-m68k.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 412Hrt5B8pzDrpm for ; Fri, 8 Jun 2018 19:57:34 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=linux-m68k.org X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=none (mailfrom) smtp.mailfrom=linux-m68k.org (client-ip=2a02:1800:120:4::f00:d; helo=newton.telenet-ops.be; envelope-from=geert@linux-m68k.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=linux-m68k.org X-Greylist: delayed 414 seconds by postgrey-1.36 at bilbo; Fri, 08 Jun 2018 19:56:06 AEST Received: from newton.telenet-ops.be (newton.telenet-ops.be [IPv6:2a02:1800:120:4::f00:d]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 412HqB4YwYzDqG0 for ; Fri, 8 Jun 2018 19:56:05 +1000 (AEST) Received: from michel.telenet-ops.be (michel.telenet-ops.be [IPv6:2a02:1800:110:4::f00:18]) by newton.telenet-ops.be (Postfix) with ESMTPS id 412Hfs37f0zMr0Qd for ; Fri, 8 Jun 2018 11:48:53 +0200 (CEST) Received: from ayla.of.borg ([84.194.111.163]) by michel.telenet-ops.be with bizsmtp id w9or1x00F3XaVaC069orKp; Fri, 08 Jun 2018 11:48:52 +0200 Received: from ramsan.of.borg ([192.168.97.29] helo=ramsan) by ayla.of.borg with esmtp (Exim 4.86_2) (envelope-from ) id 1fRE0p-0003Dk-3R; Fri, 08 Jun 2018 11:48:51 +0200 Received: from geert by ramsan with local (Exim 4.86_2) (envelope-from ) id 1fRE0p-0005YZ-6a; Fri, 08 Jun 2018 11:48:51 +0200 From: Geert Uytterhoeven To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Mauro Carvalho Chehab Subject: [PATCH] media: fsl-viu: Use proper check for presence of {out, in}_be32() Date: Fri, 8 Jun 2018 11:48:48 +0200 Message-Id: <1528451328-21316-1-git-send-email-geert@linux-m68k.org> X-Mailer: git-send-email 2.7.4 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Geert Uytterhoeven , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Arnd Bergmann , linux-media@vger.kernel.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" When compile-testing on m68k or microblaze: drivers/media/platform/fsl-viu.c:41:1: warning: "out_be32" redefined drivers/media/platform/fsl-viu.c:42:1: warning: "in_be32" redefined Fix this by replacing the check for PowerPC by checks for the presence of {out,in}_be32(). As PowerPC implements the be32 accessors using inline functions instead of macros, identity definions are added for all accessors to make the above checks work. Fixes: 29d750686331a1a9 ("media: fsl-viu: allow building it with COMPILE_TEST") Signed-off-by: Geert Uytterhoeven Reviewed-by: Hans Verkuil --- Compile-tested on m68k, microblaze, and powerpc. Assembler output before/after compared for powerpc. --- arch/powerpc/include/asm/io.h | 14 ++++++++++++++ drivers/media/platform/fsl-viu.c | 4 +++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/include/asm/io.h b/arch/powerpc/include/asm/io.h index e0331e7545685c5f..3741183ae09349f1 100644 --- a/arch/powerpc/include/asm/io.h +++ b/arch/powerpc/include/asm/io.h @@ -222,6 +222,20 @@ static inline void out_be64(volatile u64 __iomem *addr, u64 val) #endif #endif /* __powerpc64__ */ +#define in_be16 in_be16 +#define in_be32 in_be32 +#define in_be64 in_be64 +#define in_le16 in_le16 +#define in_le32 in_le32 +#define in_le64 in_le64 + +#define out_be16 out_be16 +#define out_be32 out_be32 +#define out_be64 out_be64 +#define out_le16 out_le16 +#define out_le32 out_le32 +#define out_le64 out_le64 + /* * Low level IO stream instructions are defined out of line for now */ diff --git a/drivers/media/platform/fsl-viu.c b/drivers/media/platform/fsl-viu.c index e41510ce69a40815..5d5e030c9c980647 100644 --- a/drivers/media/platform/fsl-viu.c +++ b/drivers/media/platform/fsl-viu.c @@ -37,8 +37,10 @@ #define VIU_VERSION "0.5.1" /* Allow building this driver with COMPILE_TEST */ -#ifndef CONFIG_PPC +#ifndef out_be32 #define out_be32(v, a) iowrite32be(a, (void __iomem *)v) +#endif +#ifndef in_be32 #define in_be32(a) ioread32be((void __iomem *)a) #endif