From patchwork Fri Apr 6 14:15:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 10326701 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 CD3426053F for ; Fri, 6 Apr 2018 14:15:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BD5B329518 for ; Fri, 6 Apr 2018 14:15:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B1D3129525; Fri, 6 Apr 2018 14:15:58 +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=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 301D029518 for ; Fri, 6 Apr 2018 14:15:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752958AbeDFOP5 (ORCPT ); Fri, 6 Apr 2018 10:15:57 -0400 Received: from osg.samsung.com ([64.30.133.232]:34414 "EHLO osg.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755792AbeDFOPp (ORCPT ); Fri, 6 Apr 2018 10:15:45 -0400 Received: from localhost (localhost [127.0.0.1]) by osg.samsung.com (Postfix) with ESMTP id 2551732C1D; Fri, 6 Apr 2018 07:15:45 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at dev.s-opensource.com Received: from osg.samsung.com ([127.0.0.1]) by localhost (localhost [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Mbel1ziDCguH; Fri, 6 Apr 2018 07:15:44 -0700 (PDT) Received: from vento.lan (177.17.251.195.dynamic.adsl.gvt.net.br [177.17.251.195]) by osg.samsung.com (Postfix) with ESMTPSA id 13DC832C15; Fri, 6 Apr 2018 07:15:40 -0700 (PDT) Date: Fri, 6 Apr 2018 11:15:37 -0300 From: Mauro Carvalho Chehab To: Arnd Bergmann Cc: Linux Media Mailing List , Mauro Carvalho Chehab , Hans Verkuil , Stanimir Varbanov , Benjamin Gaignard , Ramesh Shanmugasundaram , Al Viro , Bhumika Goyal , Arvind Yadav , Kees Cook , Geliang Tang Subject: Re: [PATCH 05/16] media: fsl-viu: allow building it with COMPILE_TEST Message-ID: <20180406111537.04375bdf@vento.lan> In-Reply-To: References: <24a526280e4eb319147908ccab786e2ebc8f8076.1522949748.git.mchehab@s-opensource.com> <20180406064718.2cdb69ea@vento.lan> Organization: Samsung X-Mailer: Claws Mail 3.15.1-dirty (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Em Fri, 6 Apr 2018 11:51:16 +0200 Arnd Bergmann escreveu: > On Fri, Apr 6, 2018 at 11:47 AM, Mauro Carvalho Chehab > wrote: > > > [PATCH] media: fsl-viu: allow building it with COMPILE_TEST > > > > There aren't many things that would be needed to allow it > > to build with compile test. > > > > Add the needed bits. > > > > Signed-off-by: Mauro Carvalho Chehab > > Reviewed-by: Arnd Bergmann Actually, in order to avoid warnings with smatch, the COMPILE_TEST macros should be declared as: +#define out_be32(v, a) iowrite32be(a, (void __iomem *)v) +#define in_be32(a) ioread32be((void __iomem *)a) Thanks, Mauro [PATCH] media: fsl-viu: allow building it with COMPILE_TEST There aren't many things that would be needed to allow it to build with compile test. Add the needed bits. Signed-off-by: Mauro Carvalho Chehab diff --git a/drivers/media/platform/Kconfig b/drivers/media/platform/Kconfig index 03c9dfeb7781..e6eb1eb776e1 100644 --- a/drivers/media/platform/Kconfig +++ b/drivers/media/platform/Kconfig @@ -42,7 +42,7 @@ config VIDEO_SH_VOU config VIDEO_VIU tristate "Freescale VIU Video Driver" - depends on VIDEO_V4L2 && PPC_MPC512x + depends on VIDEO_V4L2 && (PPC_MPC512x || COMPILE_TEST) select VIDEOBUF_DMA_CONTIG default y ---help--- diff --git a/drivers/media/platform/fsl-viu.c b/drivers/media/platform/fsl-viu.c index 9abe79779659..6fd1c8f66047 100644 --- a/drivers/media/platform/fsl-viu.c +++ b/drivers/media/platform/fsl-viu.c @@ -36,6 +36,12 @@ #define DRV_NAME "fsl_viu" #define VIU_VERSION "0.5.1" +/* Allow building this driver with COMPILE_TEST */ +#ifndef CONFIG_PPC +#define out_be32(v, a) iowrite32be(a, (void __iomem *)v) +#define in_be32(a) ioread32be((void __iomem *)a) +#endif + #define BUFFER_TIMEOUT msecs_to_jiffies(500) /* 0.5 seconds */ #define VIU_VID_MEM_LIMIT 4 /* Video memory limit, in Mb */ @@ -1407,7 +1413,7 @@ static int viu_of_probe(struct platform_device *op) } viu_irq = irq_of_parse_and_map(op->dev.of_node, 0); - if (viu_irq == NO_IRQ) { + if (!viu_irq) { dev_err(&op->dev, "Error while mapping the irq\n"); return -EINVAL; }