From: Hans Verkuil <hverkuil@xs4all.nl>
To: Geert Uytterhoeven <geert@linux-m68k.org>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Paul Mackerras <paulus@samba.org>,
Michael Ellerman <mpe@ellerman.id.au>,
Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org,
Arnd Bergmann <arnd@arndb.de>,
linux-media@vger.kernel.org
Subject: Re: [PATCH] media: fsl-viu: Use proper check for presence of {out,in}_be32()
Date: Fri, 18 Jan 2019 11:07:50 +0100 [thread overview]
Message-ID: <d30d5bcd-8719-ac59-adf5-08c9576be759@xs4all.nl> (raw)
In-Reply-To: <5948eb0d-410d-5bc6-a0f3-ffcaa4b3f975@xs4all.nl>
Hi Geert,
This patch is still in my patchwork todo list, and I wonder who will pick this up,
especially the change to arch/powerpc/include/asm/io.h.
Wouldn't it be easier to just fix this in fsl-viu.c only by doing this:
#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
#endif
Basically just your patch, but without removing #ifndef CONFIG_PPC.
That way there is no need to touch arch/powerpc/include/asm/io.h.
Regards,
Hans
On 6/15/18 10:10 AM, Hans Verkuil wrote:
> On 08/06/18 11:48, Geert Uytterhoeven wrote:
>> 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 <geert@linux-m68k.org>
>
> Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com>
>
> Should this go through the media tree or powerpc tree? Either way works for me.
>
> Regards,
>
> Hans
>
>> ---
>> 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
>>
>>
>
>
next prev parent reply other threads:[~2019-01-18 10:20 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-08 9:48 [PATCH] media: fsl-viu: Use proper check for presence of {out, in}_be32() Geert Uytterhoeven
2018-06-15 8:10 ` [PATCH] media: fsl-viu: Use proper check for presence of {out,in}_be32() Hans Verkuil
2019-01-18 10:07 ` Hans Verkuil [this message]
2019-01-18 10:45 ` [PATCH] media: fsl-viu: Use proper check for presence of {out, in}_be32() Geert Uytterhoeven
2020-11-19 8:01 Geert Uytterhoeven
2020-11-20 0:15 Fabio Estevam
2020-11-20 6:25 ` Michael Ellerman
2020-11-20 13:31 ` Fabio Estevam
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=d30d5bcd-8719-ac59-adf5-08c9576be759@xs4all.nl \
--to=hverkuil@xs4all.nl \
--cc=arnd@arndb.de \
--cc=benh@kernel.crashing.org \
--cc=geert@linux-m68k.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mchehab@kernel.org \
--cc=mpe@ellerman.id.au \
--cc=paulus@samba.org \
/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).