Generic Linux architectural discussions
 help / color / mirror / Atom feed
From: Ian Abbott <abbotti@mev.co.uk>
To: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org
Cc: Arnd Bergmann <arnd@arndb.de>,
	Andrew Morton <akpm@linux-foundation.org>,
	Michal Nazarewicz <mina86@mina86.com>,
	Hidehiro Kawai <hidehiro.kawai.ez@hitachi.com>,
	Borislav Petkov <bp@suse.de>,
	Rasmus Villemoes <linux@rasmusvillemoes.dk>,
	Johannes Berg <johannes.berg@intel.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Alexander Potapenko <glider@google.com>
Subject: [PATCH v4 0/2] kernel.h: container_of() pointer checking
Date: Tue, 23 May 2017 17:01:10 +0100	[thread overview]
Message-ID: <20170523160112.3446-1-abbotti@mev.co.uk> (raw)

[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(-)

             reply	other threads:[~2017-05-23 16:01 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-23 16:01 Ian Abbott [this message]
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   ` Ian Abbott
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-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

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=20170523160112.3446-1-abbotti@mev.co.uk \
    --to=abbotti@mev.co.uk \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=bp@suse.de \
    --cc=glider@google.com \
    --cc=hidehiro.kawai.ez@hitachi.com \
    --cc=johannes.berg@intel.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=mina86@mina86.com \
    --cc=peterz@infradead.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