All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] uapi/linux/stddef.h: Provide __always_inline to userspace headers
@ 2016-03-29 22:14 Denys Vlasenko
  2016-03-30 10:52 ` [tip:core/urgent] " tip-bot for Denys Vlasenko
  2016-03-30 20:00 ` [PATCH] " Josh Boyer
  0 siblings, 2 replies; 3+ messages in thread
From: Denys Vlasenko @ 2016-03-29 22: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.

Unfortunately, UAPI headers don't include compiler.h and fixing it there is not enough.

Tested. Testcase: "make headers_install" and try to compile this:

	#include <linux/swab.h>
	void main() {}

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/uapi/linux/stddef.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/include/uapi/linux/stddef.h b/include/uapi/linux/stddef.h
index aa9f104..621fa8a 100644
--- a/include/uapi/linux/stddef.h
+++ b/include/uapi/linux/stddef.h
@@ -1 +1,5 @@
 #include <linux/compiler.h>
+
+#ifndef __always_inline
+#define __always_inline inline
+#endif
-- 
1.8.1.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [tip:core/urgent] uapi/linux/stddef.h: Provide __always_inline to userspace headers
  2016-03-29 22:14 [PATCH] uapi/linux/stddef.h: Provide __always_inline to userspace headers Denys Vlasenko
@ 2016-03-30 10:52 ` tip-bot for Denys Vlasenko
  2016-03-30 20:00 ` [PATCH] " Josh Boyer
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Denys Vlasenko @ 2016-03-30 10:52 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: tglx, dvlasenk, akpm, jwboyer, rientjes, tgraf, mingo, arnd,
	peterz, hpa, torvalds, linux-kernel

Commit-ID:  283d757378371e8044d873e661b1dccee46c5887
Gitweb:     http://git.kernel.org/tip/283d757378371e8044d873e661b1dccee46c5887
Author:     Denys Vlasenko <dvlasenk@redhat.com>
AuthorDate: Wed, 30 Mar 2016 00:14:57 +0200
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Wed, 30 Mar 2016 12:50:17 +0200

uapi/linux/stddef.h: Provide __always_inline to userspace headers

Josh Boyer reported that my recent change to uapi/linux/swab.h broke the Qemu build:

  bc27fb68aaad ("include/uapi/linux/byteorder, swab: force inlining of some byteswap operations")

Unfortunately, UAPI headers don't include compiler.h so fixing it there is not enough,
add an __always_inline definition to uapi/linux/stddef.h instead.

Testcase: "make headers_install" and try to compile this:

	#include <linux/swab.h>
	void main() {}

Reported-by: Josh Boyer <jwboyer@fedoraproject.org>
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: David Rientjes <rientjes@google.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Thomas Graf <tgraf@suug.ch>
Cc: linux-kernel@vger.kernel.org
Link: http://lkml.kernel.org/r/1459289697-12875-1-git-send-email-dvlasenk@redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 include/uapi/linux/stddef.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/include/uapi/linux/stddef.h b/include/uapi/linux/stddef.h
index aa9f104..621fa8a 100644
--- a/include/uapi/linux/stddef.h
+++ b/include/uapi/linux/stddef.h
@@ -1 +1,5 @@
 #include <linux/compiler.h>
+
+#ifndef __always_inline
+#define __always_inline inline
+#endif

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] uapi/linux/stddef.h: Provide __always_inline to userspace headers
  2016-03-29 22:14 [PATCH] uapi/linux/stddef.h: Provide __always_inline to userspace headers Denys Vlasenko
  2016-03-30 10:52 ` [tip:core/urgent] " tip-bot for Denys Vlasenko
@ 2016-03-30 20:00 ` Josh Boyer
  1 sibling, 0 replies; 3+ messages in thread
From: Josh Boyer @ 2016-03-30 20:00 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 6:14 PM, Denys Vlasenko <dvlasenk@redhat.com> wrote:
> Recent change to uapi/linux/swab.h needs this.
>
> Unfortunately, UAPI headers don't include compiler.h and fixing it there is not enough.
>
> Tested. Testcase: "make headers_install" and try to compile this:
>
>         #include <linux/swab.h>
>         void main() {}
>
> 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/uapi/linux/stddef.h | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/include/uapi/linux/stddef.h b/include/uapi/linux/stddef.h
> index aa9f104..621fa8a 100644
> --- a/include/uapi/linux/stddef.h
> +++ b/include/uapi/linux/stddef.h
> @@ -1 +1,5 @@
>  #include <linux/compiler.h>
> +
> +#ifndef __always_inline
> +#define __always_inline inline
> +#endif

This does appear to fix the compile failure, so from that point of
view you can add:

Tested-by: Josh Boyer <jwboyer@fedoraproject.org>

if you'd like.

One thing I did notice that is somewhat unrelated is that the
installed linux/stddef.h is devoid of any header guards.  So it is a
file that literally just has the hunk you've patched in and doesn't
have the somewhat standard:

#ifndef _UAPI_LINUX_STDDEF_H
#define _UAPI_LINUX_STDDEF_H

...

#endif

I'm not sure how important that is, but it might be nice to add for
consistency's sake.

josh

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-03-30 20:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-29 22:14 [PATCH] uapi/linux/stddef.h: Provide __always_inline to userspace headers Denys Vlasenko
2016-03-30 10:52 ` [tip:core/urgent] " tip-bot for Denys Vlasenko
2016-03-30 20:00 ` [PATCH] " Josh Boyer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.