Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp3397192rwb; Mon, 7 Aug 2023 12:52:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGVVIQcMPLyHzbJnTyZqci8/x65wcKhX2xQtCPe4VbDezZOCxoAijF5nbLqK688r0LLaSyd X-Received: by 2002:a05:6402:78a:b0:522:5980:ae08 with SMTP id d10-20020a056402078a00b005225980ae08mr9153797edy.18.1691437972483; Mon, 07 Aug 2023 12:52:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691437972; cv=none; d=google.com; s=arc-20160816; b=ZpXEI8zNAT3hojJN8gvc1b7NQm1MeLBw5y9ATQc9yo6NYfpqskdyFWEBGc4RITlYr/ FAaOOIg0WClJcOS3RrU+2YddI8w+RZPtCiYvMcUKZz0cakfB0hx5lgXI3Kez45WXiC2M FohUpMy47IR8Y27jiN6oI6AXaow/+0xRMRKDEINPRbF1u9UmvuZCPsA0+ygpmQdDvXn8 dep0LpW6NX0TeBm5Mfpz93JhQ6/ovqaCKzT66NDZJhNM62E6PjEUj4o0lYiC0EHVXnoG iM+iUCLeeF2UzagoL3DDyWzgc0ot4jfETISIEp/Kan1kQsFb6t5+HVbhQAutofbmmlQ+ hM+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=9w+dD7oBoo3Er0Bu1CBuXGCJGgEYD7GFzLamH3ZCcr8=; fh=H916aE72tP0nYeT3Gwk1EsUKVvRhoNsiKya+K8CDpwM=; b=AAtW7resLb77VuPnpAvKYZkz626ouMio5a2NSnFnJpo3QmEli834IyKIvOUlL8rZ7t c+mcPE2XYmeaJgPCOrfNy3+/qdDDs70wUTC81BHd/B753iPmcA0ZDHrWBHbJmufaw//e jE5k+ECp8KGiI8AWXrhDNWjFCSHd4XsrDLfeNFnXn5v2Y/KGaChlRAWW4cyIcxgT+hw2 mAKLmzoutFIubr5TV7fymNWzvMYjmz1MOmYHOV8XblYKS0OsM6s1Iq6ztyA3lOSH7yAM vQDpDJua6vVEBkoVY+sM/hmjsRxyb2rSW7n4AB+CNyKvu7tcKuwlDtwKg7Tlq2aecij8 rt8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=ACLAwZ5Q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g14-20020aa7c58e000000b00522aab9defdsi5891990edq.633.2023.08.07.12.52.27; Mon, 07 Aug 2023 12:52:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=ACLAwZ5Q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229568AbjHGTtL (ORCPT + 99 others); Mon, 7 Aug 2023 15:49:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229613AbjHGTtJ (ORCPT ); Mon, 7 Aug 2023 15:49:09 -0400 Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A88821BFE for ; Mon, 7 Aug 2023 12:48:37 -0700 (PDT) Received: by mail-ed1-x52f.google.com with SMTP id 4fb4d7f45d1cf-52256241c50so7016238a12.3 for ; Mon, 07 Aug 2023 12:48:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; t=1691437638; x=1692042438; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=9w+dD7oBoo3Er0Bu1CBuXGCJGgEYD7GFzLamH3ZCcr8=; b=ACLAwZ5Q1QYlglJh/cTJUTTmgmubDo2WtPMVNFJIP6B/9pz+vkZY90O9pNMAVM293k GF3F2dxluChNVCpjeSG4B9Pfrr58vGW25dKtDK2rwQReKirZt0ep5Y2ANyw63fKb6DPE c218tSgxg3HjoEfH1taAVjczofcd5uuOx8ZMo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691437638; x=1692042438; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=9w+dD7oBoo3Er0Bu1CBuXGCJGgEYD7GFzLamH3ZCcr8=; b=jpCMZ/d2zEM4XT/B5s7mNeeV3zFQLbxUeBsrKJSSJtBg2OR9r5USuGN4gcYLmffAH2 0+is/bAjbLJQavsmO626FEoPQY5wmW0OtSiJQZ6agAcmLSac2HU52aXh3DDwBmnKxIcp 475/FQcuIX4+wCrY9HOZr70EjvKUdHjyCh7BP149sk+WKAElGxiWEYvUUAmXLGiEe3yA GY+aiSneLqC1rfarU2ZV2LWLuJhX/A8he/PAIW3bkAcOFIRhcR8oB5vpY77HhlnmTyBY AuIbvj2gUQumXE5Oir6cchT7OFISXg484h81YPH7PlLci8SmVv+YfyTGi8N3I0Q9/CyJ kDkA== X-Gm-Message-State: AOJu0YxMp3+PfJqQjPPdEJ3IhV/2IHdrubVboMbjz5bKL2aeM9RFO/qj kB5xagXGEafBWRauu9y07tYgXw== X-Received: by 2002:a17:906:1db:b0:993:f2c2:7512 with SMTP id 27-20020a17090601db00b00993f2c27512mr10894304ejj.33.1691437638444; Mon, 07 Aug 2023 12:47:18 -0700 (PDT) Received: from [192.168.1.128] (77.33.185.10.dhcp.fibianet.dk. [77.33.185.10]) by smtp.gmail.com with ESMTPSA id x13-20020a1709064bcd00b00992b3ea1ee4sm5701924ejv.149.2023.08.07.12.47.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 07 Aug 2023 12:47:17 -0700 (PDT) Message-ID: <5eca0ab5-84be-2d8f-e0b3-c9fdfa961826@rasmusvillemoes.dk> Date: Mon, 7 Aug 2023 21:47:17 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH v2 1/3] lib/vsprintf: Sort headers alphabetically Content-Language: en-US, da To: Andy Shevchenko , Petr Mladek Cc: Marco Elver , linux-kernel@vger.kernel.org, kasan-dev@googlegroups.com, linux-mm@kvack.org, Steven Rostedt , Sergey Senozhatsky , Alexander Potapenko , Dmitry Vyukov , Andrew Morton References: <20230805175027.50029-1-andriy.shevchenko@linux.intel.com> <20230805175027.50029-2-andriy.shevchenko@linux.intel.com> From: Rasmus Villemoes In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/08/2023 16.58, Andy Shevchenko wrote: > On Mon, Aug 07, 2023 at 04:31:37PM +0200, Petr Mladek wrote: >> On Sat 2023-08-05 20:50:25, Andy Shevchenko wrote: >>> Sorting headers alphabetically helps locating duplicates, and >>> make it easier to figure out where to insert new headers. >> >> I agree that includes become a mess after some time. But I am >> not persuaded that sorting them alphabetically in random source >> files help anything. >> >> Is this part of some grand plan for the entire kernel, please? >> Is this outcome from some particular discussion? >> Will this become a well know rule checked by checkpatch.pl? >> >> I am personally not going to reject patches because of wrongly >> sorted headers unless there is some real plan behind it. >> >> I agree that it might look better. An inverse Christmas' tree >> also looks better. But it does not mean that it makes the life >> easier. > > It does from my point of view as maintainability is increased. > >> The important things are still hidden in the details >> (every single line). >> >> From my POV, this patch would just create a mess in the git >> history and complicate backporting. >> >> I am sorry but I will not accept this patch unless there >> is a wide consensus that this makes sense. > > Your choice, of course, But I see in practice dup headers being > added, or some unrelated ones left untouched because header list > mess, and in those cases sorting can help (a bit) in my opinion. I agree with Andy on this one. There doesn't need to be some grand master plan to apply this to the entire kernel, but doing it to individual files bit by bit does increase the maintainability. And I really don't buy the backporting argument. Sure, backporting some patch across the release that does the sorting is harder - but then, backporting the sorting patch itself is entirely trivial (maybe not the textual part, but redoing the semantics of it is). _However_, backporting a patch from release z to release y, both of which being later than the release x that did the sorting, is going to be _easier_. It also reduces merge conflicts - that's also why lots of Makefiles are kept sorted. It's of course entirely unrelated to moving the declarations of the provided functions to a separate header file, but IMO both are worth doing. Rasmus