* [PATCH] compiler.h: Provide __always_inline to userspace headers too
@ 2016-03-29 18:14 Denys Vlasenko
2016-03-29 18:23 ` Josh Boyer
0 siblings, 1 reply; 4+ messages in thread
From: Denys Vlasenko @ 2016-03-29 18:14 UTC (permalink / raw)
To: Linus Torvalds
Cc: Denys Vlasenko, Josh Boyer, Thomas Graf, Peter Zijlstra,
David Rientjes, Arnd Bergmann, Ingo Molnar, Andrew Morton,
linux-kernel
Recent change to uapi/linux/swab.h needs this.
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
CC: Josh Boyer <jwboyer@fedoraproject.org>
CC: Thomas Graf <tgraf@suug.ch>
CC: Peter Zijlstra <peterz@infradead.org>
CC: David Rientjes <rientjes@google.com>
CC: Arnd Bergmann <arnd@arndb.de>
CC: Ingo Molnar <mingo@kernel.org>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: Linus Torvalds <torvalds@linux-foundation.org>
CC: linux-kernel@vger.kernel.org
---
include/linux/compiler.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index b5ff988..2cb6ba4 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -397,12 +397,12 @@ static __always_inline void __write_once_size(volatile void *p, void *res, int s
*/
#define noinline_for_stack noinline
+#endif /* __KERNEL__ */
+
#ifndef __always_inline
#define __always_inline inline
#endif
-#endif /* __KERNEL__ */
-
/*
* From the GCC manual:
*
--
1.8.1.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] compiler.h: Provide __always_inline to userspace headers too
2016-03-29 18:14 [PATCH] compiler.h: Provide __always_inline to userspace headers too Denys Vlasenko
@ 2016-03-29 18:23 ` Josh Boyer
2016-03-29 18:30 ` Andrew Morton
2016-03-29 18:35 ` Denys Vlasenko
0 siblings, 2 replies; 4+ messages in thread
From: Josh Boyer @ 2016-03-29 18:23 UTC (permalink / raw)
To: Denys Vlasenko
Cc: Linus Torvalds, Thomas Graf, Peter Zijlstra, David Rientjes,
Arnd Bergmann, Ingo Molnar, Andrew Morton,
Linux-Kernel@Vger. Kernel. Org
On Tue, Mar 29, 2016 at 2:14 PM, Denys Vlasenko <dvlasenk@redhat.com> wrote:
> Recent change to uapi/linux/swab.h needs this.
>
> Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
> CC: Josh Boyer <jwboyer@fedoraproject.org>
> CC: Thomas Graf <tgraf@suug.ch>
> CC: Peter Zijlstra <peterz@infradead.org>
> CC: David Rientjes <rientjes@google.com>
> CC: Arnd Bergmann <arnd@arndb.de>
> CC: Ingo Molnar <mingo@kernel.org>
> CC: Andrew Morton <akpm@linux-foundation.org>
> CC: Linus Torvalds <torvalds@linux-foundation.org>
> CC: linux-kernel@vger.kernel.org
> ---
> include/linux/compiler.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/include/linux/compiler.h b/include/linux/compiler.h
> index b5ff988..2cb6ba4 100644
> --- a/include/linux/compiler.h
> +++ b/include/linux/compiler.h
> @@ -397,12 +397,12 @@ static __always_inline void __write_once_size(volatile void *p, void *res, int s
> */
> #define noinline_for_stack noinline
>
> +#endif /* __KERNEL__ */
> +
> #ifndef __always_inline
> #define __always_inline inline
> #endif
>
> -#endif /* __KERNEL__ */
> -
Did you test this by installing the headers with 'make
headers-install' and trying to build something with the newly
installed headers? As I said in my other email, I don't see how
changes to this particular file are reflected in anything that gets
installed in /usr/include by the uapi mechanism.
josh
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] compiler.h: Provide __always_inline to userspace headers too
2016-03-29 18:23 ` Josh Boyer
@ 2016-03-29 18:30 ` Andrew Morton
2016-03-29 18:35 ` Denys Vlasenko
1 sibling, 0 replies; 4+ messages in thread
From: Andrew Morton @ 2016-03-29 18:30 UTC (permalink / raw)
To: Josh Boyer
Cc: Denys Vlasenko, Linus Torvalds, Thomas Graf, Peter Zijlstra,
David Rientjes, Arnd Bergmann, Ingo Molnar,
Linux-Kernel@Vger. Kernel. Org
On Tue, 29 Mar 2016 14:23:57 -0400 Josh Boyer <jwboyer@fedoraproject.org> wrote:
> On Tue, Mar 29, 2016 at 2:14 PM, Denys Vlasenko <dvlasenk@redhat.com> wrote:
> > Recent change to uapi/linux/swab.h needs this.
> >
> > Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
> > CC: Josh Boyer <jwboyer@fedoraproject.org>
> > CC: Thomas Graf <tgraf@suug.ch>
> > CC: Peter Zijlstra <peterz@infradead.org>
> > CC: David Rientjes <rientjes@google.com>
> > CC: Arnd Bergmann <arnd@arndb.de>
> > CC: Ingo Molnar <mingo@kernel.org>
> > CC: Andrew Morton <akpm@linux-foundation.org>
> > CC: Linus Torvalds <torvalds@linux-foundation.org>
> > CC: linux-kernel@vger.kernel.org
> > ---
> > include/linux/compiler.h | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/include/linux/compiler.h b/include/linux/compiler.h
> > index b5ff988..2cb6ba4 100644
> > --- a/include/linux/compiler.h
> > +++ b/include/linux/compiler.h
> > @@ -397,12 +397,12 @@ static __always_inline void __write_once_size(volatile void *p, void *res, int s
> > */
> > #define noinline_for_stack noinline
> >
> > +#endif /* __KERNEL__ */
> > +
> > #ifndef __always_inline
> > #define __always_inline inline
> > #endif
> >
> > -#endif /* __KERNEL__ */
> > -
>
> Did you test this by installing the headers with 'make
> headers-install' and trying to build something with the newly
> installed headers? As I said in my other email, I don't see how
> changes to this particular file are reflected in anything that gets
> installed in /usr/include by the uapi mechanism.
include/uapi/linux/swab.h already had __attribute_const__ and that
worked OK so presumably treating __always_inline in the same fashion
will also work. But yes, testing please.
Also, more care with the changelogs please. "Recent change" is
uselessly vague, and Josh kindly reported the regression, so...
From: Denys Vlasenko <dvlasenk@redhat.com>
Subject: compiler.h: provide __always_inline to userspace headers too
Recent change to uapi/linux/swab.h needs this.
In file included from test.c:2:0:
/usr/include/linux/swab.h:154:8: error: unknown type name `__always_inline'
static __always_inline __u16 __swab16p(const __u16 *p)
^~~~~~~~~~~~~~~
Fixes: bc27fb68aaad4 ("include/uapi/linux/byteorder, swab: force inlining of some byteswap operations")
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Reported-by: Josh Boyer <jwboyer@fedoraproject.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
include/linux/compiler.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff -puN include/linux/compiler.h~compilerh-provide-__always_inline-to-userspace-headers-too include/linux/compiler.h
--- a/include/linux/compiler.h~compilerh-provide-__always_inline-to-userspace-headers-too
+++ a/include/linux/compiler.h
@@ -397,12 +397,12 @@ static __always_inline void __write_once
*/
#define noinline_for_stack noinline
+#endif /* __KERNEL__ */
+
#ifndef __always_inline
#define __always_inline inline
#endif
-#endif /* __KERNEL__ */
-
/*
* From the GCC manual:
*
_
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] compiler.h: Provide __always_inline to userspace headers too
2016-03-29 18:23 ` Josh Boyer
2016-03-29 18:30 ` Andrew Morton
@ 2016-03-29 18:35 ` Denys Vlasenko
1 sibling, 0 replies; 4+ messages in thread
From: Denys Vlasenko @ 2016-03-29 18:35 UTC (permalink / raw)
To: Josh Boyer
Cc: Linus Torvalds, Thomas Graf, Peter Zijlstra, David Rientjes,
Arnd Bergmann, Ingo Molnar, Andrew Morton,
Linux-Kernel@Vger. Kernel. Org
On 03/29/2016 08:23 PM, Josh Boyer wrote:
> On Tue, Mar 29, 2016 at 2:14 PM, Denys Vlasenko <dvlasenk@redhat.com> wrote:
>> Recent change to uapi/linux/swab.h needs this.
>>
>> Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
>> CC: Josh Boyer <jwboyer@fedoraproject.org>
>> CC: Thomas Graf <tgraf@suug.ch>
>> CC: Peter Zijlstra <peterz@infradead.org>
>> CC: David Rientjes <rientjes@google.com>
>> CC: Arnd Bergmann <arnd@arndb.de>
>> CC: Ingo Molnar <mingo@kernel.org>
>> CC: Andrew Morton <akpm@linux-foundation.org>
>> CC: Linus Torvalds <torvalds@linux-foundation.org>
>> CC: linux-kernel@vger.kernel.org
>> ---
>> include/linux/compiler.h | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/include/linux/compiler.h b/include/linux/compiler.h
>> index b5ff988..2cb6ba4 100644
>> --- a/include/linux/compiler.h
>> +++ b/include/linux/compiler.h
>> @@ -397,12 +397,12 @@ static __always_inline void __write_once_size(volatile void *p, void *res, int s
>> */
>> #define noinline_for_stack noinline
>>
>> +#endif /* __KERNEL__ */
>> +
>> #ifndef __always_inline
>> #define __always_inline inline
>> #endif
>>
>> -#endif /* __KERNEL__ */
>> -
>
> Did you test this by installing the headers with 'make
> headers-install' and trying to build something with the newly
> installed headers? As I said in my other email, I don't see how
> changes to this particular file are reflected in anything that gets
> installed in /usr/include by the uapi mechanism.
You're right, #include <linux/compiler.h> gets erased in the installed headers:
headers_install.sh
...
sed -r \
-e 's/([ \t(])(__user|__force|__iomem)[ \t]/\1/g' \
-e 's/__attribute_const__([ \t]|$)/\1/g' \
-e 's@^#include <linux/compiler.h>@@' \
...
Need another location for this fix. How about uapi/linux/stddef.h ?
Currently it has just one line:
#include <linux/compiler.h>
(which gets dutifully yanked off by the install script, leaving empty file...)
Can we place
#ifndef __always_inline
#define __always_inline inline
#endif
here?
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-03-29 18:35 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-29 18:14 [PATCH] compiler.h: Provide __always_inline to userspace headers too Denys Vlasenko
2016-03-29 18:23 ` Josh Boyer
2016-03-29 18:30 ` Andrew Morton
2016-03-29 18:35 ` Denys Vlasenko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox