Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp26258807rwd; Mon, 3 Jul 2023 07:25:28 -0700 (PDT) X-Google-Smtp-Source: APBJJlGbdGcje+2Eujpq9KZUR8EknMRMjFP8FsYS9AnU3E7Eq37mc83ZR30MGI1hqLyIPNm4OLfs X-Received: by 2002:a17:903:1250:b0:1b5:5059:e733 with SMTP id u16-20020a170903125000b001b55059e733mr10784504plh.17.1688394328650; Mon, 03 Jul 2023 07:25:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688394328; cv=none; d=google.com; s=arc-20160816; b=A/Y0ZBsRFJOIanE8gJdBPxzFyEnBQ1pFoUlaPHrW9ueA4v7nKdevZiDZJ8KlXiRAYA IL2tLvsJZBK3SKnHd79hL7HOB4MNdlekWCiC4Ee5YW/fE6nJjoEm/OqUpmQ1rd45LwP9 yoeIy8wTHWOl7A1aRbTUROtb3lrzxYarNimxW8uDS1GehrB63geFAx8kTytRevU8nxpo Sajg/VIuzveY+rqoCvAUF9BHH3lu9zwRTC5lPbD+WOaoo8KK2fGwP54pQsNRsbaWEdMe vtn2yJU6SslRvdyg60kRr9zAB/QENVtFqj/b9jBpjizaZBEJ9hUGk9XefSGb0pB6spA2 KqgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=HuTrqWhavZtZfcSM41AUu5ufOr2gXQUMZpn85byL5hE=; fh=jqhk9lmQg1Vv01NnDoOXHaKKGOCixNKaQK+z4zgWqBg=; b=0ufFv/Qp8XlD9ttKC3HRcR60NO9r2fT3iK/TIL0ZzQDRuCDj3upaWPT+TDwR+c9hZe pqvDohb23NNta125m62Mxm97gdTjF/8YyTBzzh4zXKmOL+8JTMUbACBKKFoeICFdqbmx XNpeARMAhn6uS8BWizOcJUsWJXegx6tWIAR8Y2Cbs2AyNxtF3DY5nuQ7c473wckfl2Mn Y1d6uwCs11oT3ru21VoYr/pUzDcUndZidHFxviUTvt9Ml+3lGtmFVQlvNeb8czCbnpzV QHETP0r41Iy423u0zVii7nKoPN/T6vLS8zPTUxZFIcL/Wi9F86AV+0rcMK3RgjtHBZCO ov2g== ARC-Authentication-Results: i=1; mx.google.com; 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 b17-20020a170902d89100b001b7eb771d5esi16882601plz.527.2023.07.03.07.25.14; Mon, 03 Jul 2023 07:25:28 -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; 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 S229998AbjGCOC3 (ORCPT + 99 others); Mon, 3 Jul 2023 10:02:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39976 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229614AbjGCOC1 (ORCPT ); Mon, 3 Jul 2023 10:02:27 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.155.65.254]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC0B7106; Mon, 3 Jul 2023 07:02:23 -0700 (PDT) X-QQ-mid: bizesmtp66t1688392922tdq088by Received: from linux-lab-host.localdomain ( [119.123.131.49]) by bizesmtp.qq.com (ESMTP) with id ; Mon, 03 Jul 2023 22:02:00 +0800 (CST) X-QQ-SSF: 01200000000000D0W000000A0000000 X-QQ-FEAT: ILHsT53NKPhCMmoSN0mc34nVN2tnvUayvI7MBzxx9zHYJyKQV9kkg57EgKUt6 GZxsvMMNxRk+hppQv+Ccai8JrA53fYikH0nzWzLw9W2Oe2OE3mTkXcYVJmycpa2A5v2IEZl zr6Gq/Uh/PqcXof015OmnqK0s0OThKUf8SWSCzIxMg5V3kgkVzSxe0v2KP+o0cNiGApqcQR poIvP6Qeq3+eD6I18peAL8xDBg9t6cXFJwnRj00HSPrWJZfebEZQi+VufEIF7tpIR+wOnsM f78VG+JZKiq3roX8r1RChbNM4+6/Lpm0SmkWGM8zQ+nyitI10KUouywQTTwFgd37WmB1Um5 X3aP0k3/O4ARQ1M0eR01OWKWSiFZoUPgj4mvbwu8WzmWc9bI7RrkKs+GJpLiQ== X-QQ-GoodBg: 0 X-BIZMAIL-ID: 15298407468080028086 From: Zhangjin Wu To: w@1wt.eu Cc: arnd@arndb.de, david.laight@aculab.com, falcon@tinylab.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-riscv@lists.infradead.org, thomas@t-8ch.de Subject: Re: [PATCH v5 06/14] tools/nolibc: arch-*.h: clean up multiple whitespaces Date: Mon, 3 Jul 2023 22:02:00 +0800 Message-Id: <20230703140200.499769-1-falcon@tinylab.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230702184453.GF16233@1wt.eu> References: <20230702184453.GF16233@1wt.eu> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:tinylab.org:qybglogicsvrgz:qybglogicsvrgz5a-1 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Hi, Willy > Hi Zhangjin, > > On Wed, Jun 28, 2023 at 09:19:33PM +0800, Zhangjin Wu wrote: > > To align with Linux code style and let scripts/checkpatch.pl happy, the > > multiple whitespaces in arch-.h files are cleaned up. > > > > Most of them are modified by these commands automatically: > > > > $ sed -i -e '/#define my_syscall/,/})/{s/ /\t/g}' tools/include/nolibc/arch-*.h > > $ sed -i -e '/#define my_syscall/,/})/{s/ *\\$/\t\\/g}' tools/include/nolibc/arch-*.h > > > > And checked with: > > > > $ grep ' *\\$' tools/include/nolibc/arch-*.h > > I'm surprised by this one, I never saw checkpatch complain here. For me, > putting a tab after a non-tab is an error. It makes the code harder to > edit and re-align, and diffs are harder to read on lines whose lengths > varies by +/-1 around a multiple of 8 as it makes the post-tab stuff > zigzag. You made me recheck the coding style file, and there's nothing > about alignment there, only about indent (and indent uses tabs here). > There are also other parts which use spaces for alignment (albeit not > that many), so unless there is a solid reason for changing that, I'd > rather not do it, as for me it's the exact opposite of a cleanup as it > will cause me quite some discomfort. > Willy, it is not about alignment, just rechecked it, it is code indent related: #32: FILE: tools/include/nolibc/arch-mips.h:160: +^I \$ ERROR: code indent should use tabs where possible #44: FILE: tools/include/nolibc/arch-mips.h:172: +^I "t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7", "t8", "t9" \$ The first one is here: register long _arg6 = (long)(arg6); \ <-- whitespaces -->\ __asm__ volatile ( \ And the second one: : "memory", "cc", "at", "v1", "hi", "lo", \ <-spaces->"t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7", "t8", "t9" \ These two lines indent with "one tab + more than 8 whitespaces", the other lines also have whitespaces code indent, but not more than 8, so, not reported. I have tried to replace whitespaces with tabs in the first one, but the first one can not align with the other lines, so, the current modify method is applied. To only touch minimal lines, this may work (reserve the post-whitespaces): $ sed -i -e '/^\t* /{s/ /\t/g}' tools/include/nolibc/arch-*.h It will only fix up the lines the reported. The cleanup of the post-whitespaces is not necessary and it does touch too many lines. Sorry to disturb you with such cleanups, since I have seen the similar reports when we added the arch-arm.h (for my_syscall6), because the code style aligns with the others, so, I did touch it, but again encounter the same issues with arch-mips.h and to avoid the future reports, I checked the whole arch-xxx.h, and found more such reports, so, we prepared such a patch. To be honest, I do prefer post-tabs to whitespaces (less key press, less code size ;-)), but as you pointed out, post-tabs have more side-effects, we shouldn't touch them, Thanks. > > Besides, more multiple whitespaces are cleaned up: > > > > - convert "__asm__ volatile" to "__asm__ volatile" > > I totally agree on this one, it's very likely the result of a mechanical > change. Ok, will split it to a standalone patch, one error report one patch. > > > - "foo _num bar" should be "foo _num bar" > > In theory yes, except that for those where it appears it was only to > keep all declarations aligned given that this _num was shorter by one > char than all other local names. Especially when it comes to enumerating > register names, you definitely want to keep them aligned. It's sufficiently > difficult to avoid mistakes there, any help for visual check counts. > Agree, let's keep it as before. Thanks, Zhangjin > Willy