From: Sabrina Dubroca <sd@queasysnail.net>
To: Al Viro <viro@zeniv.linux.org.uk>
Cc: Bart Van Assche <bvanassche@acm.org>,
David Miller <davem@davemloft.net>,
netdev@vger.kernel.org, Willem de Bruijn <willemb@google.com>
Subject: Re: [PATCH v2 5/5] net/core: Allow the compiler to verify declaration and definition consistency
Date: Wed, 27 Mar 2019 01:03:07 +0100 [thread overview]
Message-ID: <20190327000307.GB16554@bistromath.localdomain> (raw)
In-Reply-To: <20190326181757.GB2217@ZenIV.linux.org.uk>
2019-03-26, 18:17:58 +0000, Al Viro wrote:
> Dumping everything into widely-included files is a Bloody Bad Idea(tm);
> it makes reasoning about the code much harder.
>
> If anything, we should trim the hell out of those; details that matter
> only to a well-defined subset of the kernel should be local to it.
> Consider, for example, include/net/af_unix.h. The stuff defined in
> there:
>
[snip example]
>
> Dumping internal details into include/* makes life much harder
> when working with the code, trying to understand it, etc.
> The usual reasons to separate interfaces and internals do
> apply in the kernel.
>
> Note, BTW, that stale junk (extern for a function removed at some
> point, etc.) tends to stay around, confusing the hell out of readers.
> And include/* tends to be considerably more sticky in that respect.
>
> The bottom line: keep public headers tidy; internal details belong
> with the code working with those.
Uh, yeah, makes sense. Thanks for the detailed example, I didn't think
the include/* situation was that bad.
--
Sabrina
prev parent reply other threads:[~2019-03-27 0:03 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-25 16:17 [PATCH v2 0/5] Fix net/core W=1 warnings Bart Van Assche
2019-03-25 16:17 ` [PATCH v2 1/5] net/core: Document reuseport_add_sock() bind_inany argument Bart Van Assche
2019-03-25 16:17 ` [PATCH v2 2/5] net/core: Document all dev_ioctl() arguments Bart Van Assche
2019-03-25 16:17 ` [PATCH v2 3/5] net/core: Document __skb_flow_dissect() flags argument Bart Van Assche
2019-03-25 16:17 ` [PATCH v2 4/5] net/core: Fix rtnetlink kernel-doc headers Bart Van Assche
2019-03-25 16:17 ` [PATCH v2 5/5] net/core: Allow the compiler to verify declaration and definition consistency Bart Van Assche
2019-03-25 18:26 ` Sabrina Dubroca
2019-03-26 17:11 ` Bart Van Assche
2019-03-26 23:50 ` Sabrina Dubroca
2019-03-26 18:17 ` Al Viro
2019-03-27 0:03 ` Sabrina Dubroca [this message]
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=20190327000307.GB16554@bistromath.localdomain \
--to=sd@queasysnail.net \
--cc=bvanassche@acm.org \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
--cc=willemb@google.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