Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp161553ybv; Wed, 5 Feb 2020 03:18:52 -0800 (PST) X-Google-Smtp-Source: APXvYqyhxQVrX2tqE9H0E5SV1xAsZ0Mu+9qY1LDODQLBmMudRamXKmhtWiD6l6XCjxFH/wSH6Tdg X-Received: by 2002:a05:6808:b22:: with SMTP id t2mr2466285oij.40.1580901532563; Wed, 05 Feb 2020 03:18:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580901532; cv=none; d=google.com; s=arc-20160816; b=NqbZEPgSbphmcY8jTOG4kdBFiFz6Pna29n2vt812AIK4TPD291e0JL+4tmAwP7Xq3h u90XYIvYnKchtZFqz1jz7mpb/Si/jp9XorSvWS98QO2kSnpNMXOAaeuAvE40gDShtVKs 2NWRitjof8qH8xTtzXqnZV34gSXMR6aZidLhcYxIJ7DDwJ3g/7I0tUGs8bHQx6wbjq+u 7fLYpU3zKzX8g2N494N78IaooqdxK5zKe8WeDem3A7fYEKQ3PylJqbHjrrqFyz+z9SG1 cxCfC8myNiuHVX8wLElpImb1/nJgX6ZXMJFKkURJC5uGKmeLr+sRMBRQT5c8O8iEVbD8 LuTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=AUnSDL91SYq2nII9yN+F19IeJnllXZus+lHO8VhYNwM=; b=syadJ9rRC9dYXuruZYb8fH+wx3UIQG7gVX7v1gvFGRgKtdAPnSmaDFXPYUV5h3bKlv P5CXuFgJYuuReZXBskQa7XvxPv04BKUPPehgeIi/S3suaZPVnTJQG1UUGueD9zSypISI STOD4zMSpJUxWYsjkOOUY0MwoZyMNLtsigKkw+0oBJv+tnlXHh9MIl1o04ekn0J1lxwx TW/f2SviAPG2OxI/272w6L1mA/lHSs997aciHsGwvMmats4cbzHnJlAISCHSnVyHWD3q 3Yf8XiZImPrUUPj6GYDODHlQf7Pu9dU3wT9eU1ZSSVVGvCR5BOW20/h2fmeGPTvBS5Z9 aoUA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i9si13158338otp.139.2020.02.05.03.18.39; Wed, 05 Feb 2020 03:18:52 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728282AbgBELRZ (ORCPT + 99 others); Wed, 5 Feb 2020 06:17:25 -0500 Received: from mga18.intel.com ([134.134.136.126]:2567 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727231AbgBELRY (ORCPT ); Wed, 5 Feb 2020 06:17:24 -0500 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Feb 2020 03:17:23 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,405,1574150400"; d="scan'208";a="254733294" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by fmsmga004.fm.intel.com with ESMTP; 05 Feb 2020 03:17:20 -0800 Received: from andy by smile with local (Exim 4.93) (envelope-from ) id 1izIgL-0001Mk-Rp; Wed, 05 Feb 2020 13:17:21 +0200 Date: Wed, 5 Feb 2020 13:17:21 +0200 From: Andy Shevchenko To: Joe Perches Cc: Rasmus Villemoes , Andrew Morton , linux-kernel@vger.kernel.org, Trond@black.fi.intel.com, Myklebust@black.fi.intel.com, trond.myklebust@hammerspace.com, Anna Schumaker , "Paul E. McKenney" , Josh Triplett , Steven Rostedt , Arnd Bergmann Subject: Re: [PATCH v2 1/2] kernel.h: Split out min()/max() et al helpers Message-ID: <20200205111721.GI10400@smile.fi.intel.com> References: <20200204170412.30106-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 04, 2020 at 05:17:36PM -0800, Joe Perches wrote: > On Wed, 2020-02-05 at 00:23 +0100, Rasmus Villemoes wrote: > > On 04/02/2020 18.04, Andy Shevchenko wrote: > > > kernel.h is being used as a dump for all kinds of stuff for a long time. > > > Here is the attempt to start cleaning it up by splitting out min()/max() > > > et al helpers. > > > > > > At the same time convert users in header and lib folder to use new header. > > > Though for time being include new header back to kernel.h to avoid twisted > > > indirected includes for existing users. > > > > This is definitely long overdue, so thanks for taking this on. I think > > minmax.h is fine as a header on its own, but for the other one, I think > > you should go even further - and perhaps all these should go in a > > include/math/ dir (include/linux/ has ~1200 files), so we'd have > > math/minmax.h, math/round.h, math/ilog2.h, math/gcd.h etc., each > > containing just enough #includes to be self-contained (so if there's a > > declaration of something taking a u32, there's no way around having it > > include types.h (or wherever that's defined). > > I think that's not at all desirable. device.h has been recently split to a 4 files (by Linus [old] request). Any comments on that? > kernel.h as a monolithic include block is pretty useful. > > Separating out the various bits into separate files is > OK, but kernel.h should #include them all. That's fine but should not make people think this is a good idea to include only one header to their modules. > One day a precompiled header of just kernel.h would be > useful to reduce overall compilation time. All years no change. > Converting > all the other source files that use a small part of the > existing kernel.h into multiple includes would not allow > precompiled headers to work efficiently. -- With Best Regards, Andy Shevchenko