From: Arnd Bergmann <arnd@arndb.de>
To: Yuval Mintz <Yuval.Mintz@qlogic.com>
Cc: Baoyou Xie <baoyou.xie@linaro.org>,
netdev <netdev@vger.kernel.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
"xie.baoyou@zte.com.cn" <xie.baoyou@zte.com.cn>,
Ariel Elior <Ariel.Elior@qlogic.com>
Subject: Re: [PATCH] qed: add missing header dependencies
Date: Wed, 07 Sep 2016 14:52:56 +0200 [thread overview]
Message-ID: <5820324.xrfiu7KHci@wuerfel> (raw)
In-Reply-To: <DM5PR11MB17236A48767FEFB5C59426A297F80@DM5PR11MB1723.namprd11.prod.outlook.com>
On Wednesday, September 7, 2016 12:31:03 PM CEST Yuval Mintz wrote:
> > > While I obviously have no strong objection for including
> > > qed_selftest.h from qed_selftest.c, I'm not sure I understand which C
> > > standard dictates this requirement.
> > > Why should a function definition [not call] be preceded by a prototype?
> >
> > - When a function is defined in one file and used in another, you want
> > both files to include the same header that has the declaration to
> > ensure that the types are identical. There are cases where the
> > prototype is changed after the fact in an incompatible way, causing
> > silent data corruption on some configurations but maybe not on others.
>
> O.k., motivation is clear.
> But this really isn't enforced by the ansi-c standard, right?
No, ansi-c doesn't enforce this, and even the regular kernel build
flags don't enable the warning in question, we only get it when
either building with "make C=1" using sparse, or "make W=1" to
enable extra warnings from gcc.
The warning is however really useful, and I hope that we go through
all drivers in the kernel and eliminate these warnings in order
to turn them on by default for all drivers.
> Acked-by: Yuval Mintz <Yuval.Mintz@qlogic.com>
Thanks,
Arnd
next prev parent reply other threads:[~2016-09-07 12:52 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-07 11:07 [PATCH] qed: add missing header dependencies Baoyou Xie
2016-09-07 11:37 ` Yuval Mintz
2016-09-07 12:17 ` Arnd Bergmann
2016-09-07 12:31 ` Yuval Mintz
2016-09-07 12:52 ` Arnd Bergmann [this message]
2016-09-08 0:41 ` David Miller
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=5820324.xrfiu7KHci@wuerfel \
--to=arnd@arndb.de \
--cc=Ariel.Elior@qlogic.com \
--cc=Yuval.Mintz@qlogic.com \
--cc=baoyou.xie@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=xie.baoyou@zte.com.cn \
/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