Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp3516775pxa; Wed, 26 Aug 2020 02:31:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwAJ164fChiL0ZjNUYCaUoN7Y/hCdCyTTLJDIGm1xOij9nvlI2vQEyiXW+Lu8IiAeobyq06 X-Received: by 2002:a05:6402:1545:: with SMTP id p5mr13614081edx.388.1598434299366; Wed, 26 Aug 2020 02:31:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598434299; cv=none; d=google.com; s=arc-20160816; b=rAayA+I/LENav1HheqMpsDdFkWErJfFborzy9kGIbbbVFgEdClfWXzXhdMOE5MXacx BoDAcscqc4VEpyChiBn3KB96Bkc0jRGRdNUK4sSSmU+Yyfcs2aWz0SbNLYSptF2cI2FW hi5lKVLZiSxnLARmncLPiK0Ret7ICo86rGt1iSbbQsXJRctoADSbXeq5s7MvY1XJD4Aj rXKJs9TsbizgJkIrarF0loNzPXG2fkB1hWYzGEIWASJvcQoQu0EahcMMGyfY373i12ZE Kvn/pX/0ZFe7pzQ7qOofkCwcyQOzg2SFTvduQQDVghaRklN9oHy8JmLJQy1XIQIqJYL8 lR0w== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=/gMUiMG+L1pALs2xZKCOgCLHQfE5SgnBZ2FpjfreOaM=; b=k9GIkYORonayCJBfX6+bQMSJBbXiCK7JAGtbytyzYq3Mc1iy8WnV/Ks3G1c/P29tgh c3hsDVHHetvkyU3uMI/huhCVwWlUIGggRZHZwHYV9S6DbUHHgzXmPQ7ut3MjGHFtgtmW nL5VgL+BPkUF70fJUA9oV6l5rOQUd81sNlJu5QbGZrED6lVaVR6moBMETStP5J0Vsokk 2+JjOFijr+MbnoIK2tlw+5mxE9RktemetxYczsWBT/J2kIiwacCRUp3bAdTVbYemEqG0 CfdO3pk6kdeT3KEmDHsCSS0GfHDgq1Kk15DAxI7AjePBqh5aQDyJUdqNWpu8NTd/0ntM lDgg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e24si1054427eds.212.2020.08.26.02.31.17; Wed, 26 Aug 2020 02:31:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727994AbgHZJaR (ORCPT + 99 others); Wed, 26 Aug 2020 05:30:17 -0400 Received: from mx2.suse.de ([195.135.220.15]:50246 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727854AbgHZJaR (ORCPT ); Wed, 26 Aug 2020 05:30:17 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id EC6AFAD39; Wed, 26 Aug 2020 09:30:46 +0000 (UTC) From: Thomas Renninger To: Jiri Kosina , linux-kernel@vger.kernel.org, Joe Perches Cc: Shuah Khan , linux-pm@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: Re: [PATCH 29/29] tools: Avoid comma separated statements Date: Wed, 26 Aug 2020 11:30:14 +0200 Message-ID: <6011591.XMClsHuqKX@c100> In-Reply-To: <52b68acfeb441b483de188f7e100600291f8c3ec.1598331149.git.joe@perches.com> References: <52b68acfeb441b483de188f7e100600291f8c3ec.1598331149.git.joe@perches.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, getting rid of lines with multiple instructions, separated by comma is certainly a good idea. One nit pick, though: Am Dienstag, 25. August 2020, 06:56:26 CEST schrieb Joe Perches: > Use semicolons and braces. > > Signed-off-by: Joe Perches > --- > tools/lib/subcmd/help.c | 10 +- > tools/power/cpupower/utils/cpufreq-set.c | 14 +- > tools/testing/selftests/vm/gup_benchmark.c | 18 +- > tools/testing/selftests/vm/userfaultfd.c | 296 +++++++++++++-------- > 4 files changed, 210 insertions(+), 128 deletions(-) > > diff --git a/tools/lib/subcmd/help.c b/tools/lib/subcmd/help.c > index 2859f107abc8..bf02d62a3b2b 100644 > --- a/tools/lib/subcmd/help.c > +++ b/tools/lib/subcmd/help.c > @@ -65,12 +65,14 @@ void exclude_cmds(struct cmdnames *cmds, struct cmdnames > *excludes) ci = cj = ei = 0; > while (ci < cmds->cnt && ei < excludes->cnt) { > cmp = strcmp(cmds->names[ci]->name, excludes->names[ei]->name); > - if (cmp < 0) > + if (cmp < 0) { > cmds->names[cj++] = cmds->names[ci++]; > - else if (cmp == 0) > - ci++, ei++; > - else if (cmp > 0) > + } else if (cmp == 0) { > + ci++; > ei++; > + } else if (cmp > 0) { > + ei++; > + } > } I can remember patches being rejected with one line statements in a condition, surounded by braces. I just read up Documentation/process/coding-style.rst, to be sure this still is up-to-date. It's not a must, but line 180 says: "Do not unnecessarily use braces where a single statement will do." So if this is about coding style cleanup, IMO you should remove braces from single line statements. I haven't reviewed every line, but I expect you only split up comma separated instructions into separate lines and added braces? Afaik there isn't a specific tag, but having: cleanup only: No functional change in the changelog would be nice for people looking for fixes to backport. Otherwise, I think this is a worthful cleanup. Thomas