From: Hugh Dickins <hughd@google.com>
To: "Luck, Tony" <tony.luck@intel.com>
Cc: "ksummit-discuss@lists.linuxfoundation.org"
<ksummit-discuss@lists.linuxfoundation.org>
Subject: Re: [Ksummit-discuss] Should we force include <linux/err.h> when compiling all .c files?
Date: Tue, 29 Jul 2014 09:50:34 -0700 (PDT) [thread overview]
Message-ID: <alpine.LSU.2.11.1407290938040.4599@eggly.anvils> (raw)
In-Reply-To: <3908561D78D1C84285E8C5FCA982C28F3287CFFB@ORSMSX114.amr.corp.intel.com>
On Tue, 29 Jul 2014, Luck, Tony wrote:
> > Perhaps, though see above about the handling of new source files.
>
> Sounds like a job for checkpatch.pl to make sure that <linux/err.h>
> is included if a new file uses any of 'IS_ERR\|ERR_PTR\|PTR_ERR\|ERR_CAST'
> to help stop this spreading to new files.
>
> It might be harder, but presumably still possible, to have it also check if
> any use of those macros is added to a file ... but it couldn't tell just by
> looking at the patch ... it would have to peek at the original file to see
> if there was already a #include <linux/err.h>
>
> Without a check, or some regular scan, this problem is going to recur.
I keep wondering, what _is_ the problem being discussed here?
If someone uses IS_ERR etc without linux/err.h being included,
does the kernel behave in a dangerously unpredictable way?
Or does the build just fail?
So, there's a rule that everybody should include every header
file that's used directly by a particular source file.
Good rule, but somehow I doubt that omitting linux/err.h
is the sole example of that rule being broken.
And our response to that is to get the kbuild system to include
automatically any header files frequently forgotten?
Hugh
next prev parent reply other threads:[~2014-07-29 16:52 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-25 12:39 David Howells
2014-07-25 23:24 ` Josh Triplett
2014-07-28 18:52 ` H. Peter Anvin
2014-07-28 20:16 ` Julia Lawall
2014-07-28 22:53 ` H. Peter Anvin
2014-07-29 14:35 ` Josh Triplett
2014-07-29 15:17 ` Luck, Tony
2014-07-29 16:50 ` Hugh Dickins [this message]
2014-07-29 19:06 ` Hugh Dickins
2014-07-29 14:24 ` Josh Triplett
2014-07-30 14:30 ` H. Peter Anvin
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=alpine.LSU.2.11.1407290938040.4599@eggly.anvils \
--to=hughd@google.com \
--cc=ksummit-discuss@lists.linuxfoundation.org \
--cc=tony.luck@intel.com \
/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