[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAK8P3a34sHv05FYwcmuJzsR4NM4r2TcrhCE8LTDtRtNvhN9hWw@mail.gmail.com>
Date: Wed, 24 Feb 2021 09:41:20 +0100
From: Arnd Bergmann <arnd@...nel.org>
To: Masahiro Yamada <masahiroy@...nel.org>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Arnd Bergmann <arnd@...db.de>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
linux-arch <linux-arch@...r.kernel.org>
Subject: Re: [PATCH] asm-generic/ioctl.h: use BUILD_BUG_ON_ZERO() for type check
On Wed, Feb 24, 2021 at 2:57 AM Masahiro Yamada <masahiroy@...nel.org> wrote:
>
> On Wed, Feb 24, 2021 at 5:04 AM Arnd Bergmann <arnd@...nel.org> wrote:
> >
> > On Tue, Feb 23, 2021 at 11:06 AM Masahiro Yamada <masahiroy@...nel.org> wrote:
>
> My intention is to improve the UAPI/KAPI decoupling
> to decrease the task of scripts/headers_install.sh
>
> Ideally, we could export UAPI headers with
> almost no modification.
>
> It is true that scripts/unifdef can remove #ifndef __KERNEL__
> blocks, but having the kernel-space code in UAPI headers
> does not make sense. Otherwise, our initial motivation
> "separate them by directory structure" would be lost.
>
> So, I believe redefining _IOC_TYPECHECK is the right direction.
> I can add comments if this is not clear.
Maybe using '#ifndef _IOC_TYPECHECK' would help here?
Another alternative might be to find a way to rewrite the typecheck
macro to make it safe to be used in user space as well, and not
have two different versions.
Arnd
Powered by blists - more mailing lists