linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@s-opensource.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Linux Media Mailing List <linux-media@vger.kernel.org>,
	Mauro Carvalho Chehab <mchehab@infradead.org>,
	Hans Verkuil <hans.verkuil@cisco.com>,
	Stanimir Varbanov <stanimir.varbanov@linaro.org>,
	Benjamin Gaignard <benjamin.gaignard@linaro.org>,
	Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>,
	Al Viro <viro@zeniv.linux.org.uk>,
	Bhumika Goyal <bhumirks@gmail.com>,
	Arvind Yadav <arvind.yadav.cs@gmail.com>,
	Kees Cook <keescook@chromium.org>,
	Geliang Tang <geliangtang@gmail.com>
Subject: Re: [PATCH 05/16] media: fsl-viu: allow building it with COMPILE_TEST
Date: Fri, 6 Apr 2018 06:47:18 -0300	[thread overview]
Message-ID: <20180406064718.2cdb69ea@vento.lan> (raw)
In-Reply-To: <CAK8P3a1a7r1FNhpRHJfyzRNHgNHOzcK1wkerYb+BR_RjWNkOUQ@mail.gmail.com>

Em Thu, 5 Apr 2018 23:35:06 +0200
Arnd Bergmann <arnd@arndb.de> escreveu:

> On Thu, Apr 5, 2018 at 7:54 PM, Mauro Carvalho Chehab
> <mchehab@s-opensource.com> wrote:
> > There aren't many things that would be needed to allow it
> > to build with compile test.  
> 
> > +/* Allow building this driver with COMPILE_TEST */
> > +#ifndef CONFIG_PPC_MPC512x
> > +#define NO_IRQ   0  
> 
> The NO_IRQ usage here really needs to die. The portable way to do this
> is the simpler
> 
> diff --git a/drivers/media/platform/fsl-viu.c b/drivers/media/platform/fsl-viu.c
> index 200c47c69a75..707bda89b4f7 100644
> --- a/drivers/media/platform/fsl-viu.c
> +++ b/drivers/media/platform/fsl-viu.c
> @@ -1407,7 +1407,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;
>         }
> 
> > +#define out_be32(v, a) writel(a, v)
> > +#define in_be32(a) readl(a)  
> 
> This does get it to compile, but looks confusing because it mixes up the
> endianess. I'd suggest doing it like
> 
> #ifndef CONFIG_PPC
> #define out_be32(v, a) iowrite32be(a, v)
> #define in_be32(a) ioread32be(a)
> #endif
> 
>       Arnd

Thanks for the review. Yeah, that looks better. Patch enclosed.

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 <mchehab@s-opensource.com>

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..f54592c431d3 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, v)
+#define in_be32(a)	ioread32be(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;
 	}

  reply	other threads:[~2018-04-06  9:47 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-05 17:54 [PATCH 00/16] Make all drivers under drivers/media to build with COMPILE_TEST Mauro Carvalho Chehab
2018-04-05 17:54 ` [PATCH 01/16] omap: omap-iommu.h: allow building drivers " Mauro Carvalho Chehab
2018-04-08 10:12   ` Matthias Schwarzott
2018-04-17  8:52     ` Mauro Carvalho Chehab
2018-04-05 17:54 ` [PATCH 02/16] media: omap3isp: allow it to build " Mauro Carvalho Chehab
2018-04-05 18:30   ` Laurent Pinchart
2018-04-05 19:44     ` Mauro Carvalho Chehab
2018-04-07 11:56       ` Laurent Pinchart
2018-04-07 13:14         ` Mauro Carvalho Chehab
2018-04-09  8:50           ` Arnd Bergmann
2018-04-09  9:48             ` Mauro Carvalho Chehab
2018-04-07  5:23   ` kbuild test robot
2018-04-05 17:54 ` [PATCH 03/16] media: omap3isp/isp: remove an unused static var Mauro Carvalho Chehab
2018-04-05 18:34   ` Laurent Pinchart
2018-04-05 17:54 ` [PATCH 04/16] media: fsl-viu: mark static functions as such Mauro Carvalho Chehab
2018-04-05 17:54 ` [PATCH 05/16] media: fsl-viu: allow building it with COMPILE_TEST Mauro Carvalho Chehab
2018-04-05 21:35   ` Arnd Bergmann
2018-04-06  9:47     ` Mauro Carvalho Chehab [this message]
2018-04-06  9:51       ` Arnd Bergmann
2018-04-06 14:15         ` Mauro Carvalho Chehab
2018-04-06 14:16           ` Arnd Bergmann
2018-04-06 14:26             ` Mauro Carvalho Chehab
2018-04-06 14:37               ` Arnd Bergmann
2018-04-06 14:47                 ` Mauro Carvalho Chehab
2018-04-06 19:15   ` kbuild test robot
2018-04-05 17:54 ` [PATCH 06/16] media: cec_gpio: allow building CEC_GPIO " Mauro Carvalho Chehab
2018-04-05 17:54 ` [PATCH 07/16] media: exymos4-is: allow compile test for EXYNOS FIMC-LITE Mauro Carvalho Chehab
2018-04-09  9:49   ` Sylwester Nawrocki
2018-04-05 17:54 ` [PATCH 08/16] media: mmp-camera.h: add missing platform data Mauro Carvalho Chehab
2018-04-05 17:54 ` [PATCH 09/16] media: marvel-ccic: re-enable mmp-driver build Mauro Carvalho Chehab
2018-04-05 17:54 ` [PATCH 10/16] media: mmp-driver: make two functions static Mauro Carvalho Chehab
2018-04-05 17:54 ` [PATCH 11/16] media: davinci: allow building isif code Mauro Carvalho Chehab
2018-04-05 17:54 ` [PATCH 12/16] media: davinci: allow build vpbe_display with COMPILE_TEST Mauro Carvalho Chehab
2018-04-05 17:54 ` [PATCH 13/16] media: vpbe_venc: don't store return codes if they won't be used Mauro Carvalho Chehab
2018-04-05 17:54 ` [PATCH 14/16] media: davinci: get rid of lots of kernel-doc warnings Mauro Carvalho Chehab
2018-04-05 17:54 ` [PATCH 15/16] media: omapfb_dss.h: add stubs to build with COMPILE_TEST Mauro Carvalho Chehab
2018-04-05 18:41   ` Laurent Pinchart
2018-04-05 19:32     ` Mauro Carvalho Chehab
2018-04-05 17:54 ` [PATCH 16/16] media: omap: allow building it " Mauro Carvalho Chehab
2018-04-05 18:15   ` Mauro Carvalho Chehab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180406064718.2cdb69ea@vento.lan \
    --to=mchehab@s-opensource.com \
    --cc=arnd@arndb.de \
    --cc=arvind.yadav.cs@gmail.com \
    --cc=benjamin.gaignard@linaro.org \
    --cc=bhumirks@gmail.com \
    --cc=geliangtang@gmail.com \
    --cc=hans.verkuil@cisco.com \
    --cc=keescook@chromium.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@infradead.org \
    --cc=ramesh.shanmugasundaram@bp.renesas.com \
    --cc=stanimir.varbanov@linaro.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).