Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp12588ybv; Tue, 4 Feb 2020 15:25:38 -0800 (PST) X-Google-Smtp-Source: APXvYqysC5QpD1lxvp8jR/Z3nFm3rx2VK2cTYXozYmsX66wTe8fkuTYoVZ7pmAdYcF0XWdvUJtEY X-Received: by 2002:a05:6830:4a7:: with SMTP id l7mr22670357otd.372.1580858737960; Tue, 04 Feb 2020 15:25:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580858737; cv=none; d=google.com; s=arc-20160816; b=rAsih/U7cOvb826+kmXuFmqlAeW3GYdNO59IRSKXIfWfYLxFIwduH9wbH8jlwUI9om yiKi2VLdiq3QST0EWywYI9cTgKJ8dToZXEbLpUVTOMdGnwbKGxfgYhuyhMNcSJE1RPq7 6nyPM1p9lVBbkBI8Gf4G2q9lfjM67wT22UOFeEHzZ61C7hUVUA+5ESEG5fEoOLlt19mx 6ISiBJWLiqGwJea8KKqi5Z6x5Svbu9ja3gdVNIZc5T81gBkv2gMfWP4fA3+/JEy171u0 2YFdPbHwczw/r2TZKXeVyScPvA2hvF9Cb0/ph3fJdTLypT+Aexb152R7a6B0fCGvmdMc NrKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject:dkim-signature; bh=yzs8TJvyQFCvJyaNWKZJmpZR9rIBxqg0DMsRTVYEQE4=; b=Bfk47khilDd8Ic4/+7l+X7dPcJlojUXO3PjxBHj6klvQjNyqFqpTi0OkGIanRMUCQS Yvkp3geZPzjnuHIsCU5YSWQRgL0OfoKy8DPPZNGP08ZiiIftTSXus10Zk9SJUazdUdbK EwRsbNsAYv53jMSblwZSXYziWIKcPLMNCiJ1sYESpE0gcfr2KUA3rYhBg3LN8H7GC2Ri SjsSddpP/eJfOTcQuJCJOd50oBfvcyfR0L2C/WJld4AUeVguAd8mM/ZFthpLxOgw+2Ei pqcPTgASbY9NRCfYLy+23xuJu1Te3m0etJPXPmOihawDZnRmli10y4a1SrULE3cOMWKf ttig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=HUffOfge; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y12si11841116oti.162.2020.02.04.15.25.25; Tue, 04 Feb 2020 15:25:37 -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; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=HUffOfge; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727578AbgBDXX5 (ORCPT + 99 others); Tue, 4 Feb 2020 18:23:57 -0500 Received: from mail-wr1-f66.google.com ([209.85.221.66]:38729 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727483AbgBDXX4 (ORCPT ); Tue, 4 Feb 2020 18:23:56 -0500 Received: by mail-wr1-f66.google.com with SMTP id y17so268513wrh.5 for ; Tue, 04 Feb 2020 15:23:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=yzs8TJvyQFCvJyaNWKZJmpZR9rIBxqg0DMsRTVYEQE4=; b=HUffOfgeXHgJpzF4ELf8SsmlNMmo0Np0N/0pdLSdlCZDOks9I3Eteh3c3+PUOrJJTy 5EVAk+gDMmN4NRsP/DFau1Vog+7aUbNIyeq6hBa3Q6i3AMpkg3xNKR1QfY8qXVaZHR8t /5QYfvI1RtAjZCNwPmmOufRXW7dHtPEWJ9O6Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=yzs8TJvyQFCvJyaNWKZJmpZR9rIBxqg0DMsRTVYEQE4=; b=gRqqwbPBNCPFxMf38A3wxO37uO2wFfmm4jvdNvVGzxk1S0TckupTtAz47ZWOEcopya KNnJPLEx9GwsYO1tAcYhofRXim7LMUzXPr6VtHK2J/cOgSw081jA5YKJk77PqRmtbYfW vWETBquLTS8XtQOIgPFJa1g9kbj9BYACzFwVJN8piMzbNxal2EdftIVWumHi6rg3jjQL uo5GWsN304FQ9tdILhgOIAbIyj/3dUQZqiqg3mRU0aBYj48rumxkeCktX9LpDG+23ewo UWc8szLSjvQq0JgQho+nwdspeEa+n7lHlkUfOqikb+Q5hdXGOPxxLNPYhM23RUPpee47 xLyw== X-Gm-Message-State: APjAAAWuyQQp+cclfQsMCM2kGQKXfRu25lF0pXqAZY1NBtKen3wzO1aD Si/DjKYuSmpSjLOyh4LKRx2LsQ== X-Received: by 2002:a5d:4612:: with SMTP id t18mr22932545wrq.98.1580858635051; Tue, 04 Feb 2020 15:23:55 -0800 (PST) Received: from [192.168.1.149] (ip-5-186-115-54.cgn.fibianet.dk. [5.186.115.54]) by smtp.gmail.com with ESMTPSA id a13sm32643924wrp.93.2020.02.04.15.23.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 04 Feb 2020 15:23:54 -0800 (PST) Subject: Re: [PATCH v2 1/2] kernel.h: Split out min()/max() et al helpers To: Andy Shevchenko , 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 References: <20200204170412.30106-1-andriy.shevchenko@linux.intel.com> From: Rasmus Villemoes Message-ID: Date: Wed, 5 Feb 2020 00:23:53 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <20200204170412.30106-1-andriy.shevchenko@linux.intel.com> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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). Rasmus