From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 88992C43381 for ; Wed, 27 Mar 2019 00:03:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4BD412087C for ; Wed, 27 Mar 2019 00:03:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731666AbfC0ADL (ORCPT ); Tue, 26 Mar 2019 20:03:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46878 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726782AbfC0ADL (ORCPT ); Tue, 26 Mar 2019 20:03:11 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B55E6308FF2C; Wed, 27 Mar 2019 00:03:10 +0000 (UTC) Received: from bistromath.localdomain (unknown [10.40.205.83]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5DF471001925; Wed, 27 Mar 2019 00:03:09 +0000 (UTC) Date: Wed, 27 Mar 2019 01:03:07 +0100 From: Sabrina Dubroca To: Al Viro Cc: Bart Van Assche , David Miller , netdev@vger.kernel.org, Willem de Bruijn Subject: Re: [PATCH v2 5/5] net/core: Allow the compiler to verify declaration and definition consistency Message-ID: <20190327000307.GB16554@bistromath.localdomain> References: <20190325161723.144556-1-bvanassche@acm.org> <20190325161723.144556-6-bvanassche@acm.org> <20190325182642.GA14636@bistromath.localdomain> <20190326181757.GB2217@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190326181757.GB2217@ZenIV.linux.org.uk> User-Agent: Mutt/1.11.4 (2019-03-13) X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Wed, 27 Mar 2019 00:03:10 +0000 (UTC) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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