mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: David Howells <dhowells@redhat.com>, linux-kernel@vger.kernel.org
Subject: Re: compiler_types.h in UAPI?
Date: Mon, 6 May 2024 11:39:10 +0300	[thread overview]
Message-ID: <ZjiXLm9ZnJwMHiBP@smile.fi.intel.com> (raw)
In-Reply-To: <cb22252d-1ea9-4094-9f7a-b94c2142d1f2@app.fastmail.com>

On Fri, May 03, 2024 at 09:34:13PM +0200, Arnd Bergmann wrote:
> On Fri, May 3, 2024, at 20:57, Andy Shevchenko wrote:

> > Today I have stumbled over use of __force and other compiler_types.h related
> > things in UAPI headers. Can anybody explain to me how do they suppose to work
> > outside of the kernel? Or did I miss something obvious? Or it was a mistake
> > during UAPI split to move swab.h and byteorder/ (most of the users of those)
> > to UAPI in the first place?
> 
> These get stripped out by scripts/headers_install.sh during
> the 'make headers_install' stage:
> 
> sed -E -e '
>         s/([[:space:](])(__user|__force|__iomem)[[:space:]]/\1/g
>         s/__attribute_const__([[:space:]]|$)/\1/g
>         s@^#include <linux/compiler(|_types).h>@@
>         s/(^|[^a-zA-Z0-9])__packed([^a-zA-Z0-9_]|$)/\1__attribute__((packed))\2/g
>         s/(^|[[:space:](])(inline|asm|volatile)([[:space:](]|$)/\1__\2__\3/g
>         s@#(ifndef|define|endif[[:space:]]*/[*])[[:space:]]*_UAPI@#\1 @
> ' $INFILE > $TMPFILE || exit 1

Thanks, Arnd, TIL!

But do we discourage using these in UAPI in general? I mean do we have
this somewhere being documented?

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2024-05-06  8:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-03 18:57 Andy Shevchenko
2024-05-03 19:34 ` Arnd Bergmann
2024-05-06  8:39   ` Andy Shevchenko [this message]
2024-05-06  9:57     ` Arnd Bergmann

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=ZjiXLm9ZnJwMHiBP@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=arnd@arndb.de \
    --cc=dhowells@redhat.com \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®