All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/2] kernel.h: container_of() pointer checking
@ 2017-05-23 16:01 Ian Abbott
  2017-05-23 16:01 ` [PATCH v4 1/2] asm-generic/bug.h: declare struct pt_regs; before function prototype Ian Abbott
  2017-05-23 16:01 ` [PATCH v4 2/2] kernel.h: handle pointers to arrays better in container_of() Ian Abbott
  0 siblings, 2 replies; 14+ messages in thread
From: Ian Abbott @ 2017-05-23 16:01 UTC (permalink / raw)
  To: linux-kernel, linux-arch
  Cc: Arnd Bergmann, Andrew Morton, Michal Nazarewicz, Hidehiro Kawai,
	Borislav Petkov, Rasmus Villemoes, Johannes Berg, Peter Zijlstra,
	Alexander Potapenko

[I screwed up an 'Acked-by:' line on v3.]

Patch 2 changes the container_of() macro to improve the compatibility
checking when the member has array type.  As a bonus (?), if the pointer
neither points to a type compatible with the member nor points to a type
compatible with void, compiler errors are produced instead of warnings.

Patch 1 is a prerequisite to avoid a lot of warnings when <linux/bug.h>
is included by <linux/kernel.h>.

1) asm-generic/bug.h: declare struct pt_regs; before function prototype
2) kernel.h: handle pointers to arrays better in container_of()

 include/asm-generic/bug.h | 1 +
 include/linux/kernel.h    | 9 ++++++---
 2 files changed, 7 insertions(+), 3 deletions(-)

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

end of thread, other threads:[~2017-05-24 18:59 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-23 16:01 [PATCH v4 0/2] kernel.h: container_of() pointer checking Ian Abbott
2017-05-23 16:01 ` [PATCH v4 1/2] asm-generic/bug.h: declare struct pt_regs; before function prototype Ian Abbott
2017-05-23 18:44   ` Michal Nazarewicz
2017-05-23 18:44     ` Michal Nazarewicz
2017-05-23 18:44     ` Michal Nazarewicz
2017-05-23 16:01 ` [PATCH v4 2/2] kernel.h: handle pointers to arrays better in container_of() Ian Abbott
2017-05-23 18:44   ` Michal Nazarewicz
2017-05-23 18:44     ` Michal Nazarewicz
2017-05-23 18:44     ` Michal Nazarewicz
2017-05-24  0:54   ` kbuild test robot
2017-05-24  0:54     ` kbuild test robot
2017-05-24  0:54     ` kbuild test robot
2017-05-24 10:46     ` Ian Abbott
2017-05-24 18:59       ` Andrew Morton

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.