[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170523160112.3446-1-abbotti@mev.co.uk>
Date: Tue, 23 May 2017 17:01:10 +0100
From: Ian Abbott <abbotti@....co.uk>
To: linux-kernel@...r.kernel.org, linux-arch@...r.kernel.org
Cc: Arnd Bergmann <arnd@...db.de>,
Andrew Morton <akpm@...ux-foundation.org>,
Michal Nazarewicz <mina86@...a86.com>,
Hidehiro Kawai <hidehiro.kawai.ez@...achi.com>,
Borislav Petkov <bp@...e.de>,
Rasmus Villemoes <linux@...musvillemoes.dk>,
Johannes Berg <johannes.berg@...el.com>,
Peter Zijlstra <peterz@...radead.org>,
Alexander Potapenko <glider@...gle.com>
Subject: [PATCH v4 0/2] kernel.h: container_of() pointer checking
[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(-)
Powered by blists - more mailing lists