Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp360527pxb; Wed, 14 Apr 2021 17:50:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyTmy7Pzd62ooYk8+xBO2l/2102zj3qoLJoud5y3chqUmDr8eSAskq1VTvHZiQ3K83d6m0n X-Received: by 2002:a05:6402:1255:: with SMTP id l21mr411959edw.362.1618447801926; Wed, 14 Apr 2021 17:50:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618447801; cv=none; d=google.com; s=arc-20160816; b=P53RrGIUaiczMP95zfhRaQiS57+IDql0Ca+En6rLlPouNgtKqL/LRw9RwhhZ81zd8E wBngMxHRZEeWIiM+4cec8v0P/qB1Nj0FfB8A8Vboqv4nAJ9Lr8kJ+JwoOCSN5vUHe1mr A56WSO0XnDFBw/Kxf6JwgmeYly94ZKCYPDYxjZdego9ZY8y/Klyva2ND1uKjBUdUEkjG Rb3rJhj8yTIL+/cTcruHpNXnc11Cd9C+jH9W+dMyQWRYQwuxJ0y2KV2+HMoDBXv0XwEi x6uLDshULc4kpNdCQmp+t/EMlX/+XjNh8ruYkYnTR79VGGYEK4KtBgRyCc8/X6BLPEZX BYHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=HSRWSjJIyTOfOO8D771rBsEaBLI9bpiKOdKKIXVQ4CQ=; b=eIRHACRQs7L3RX8cABUz7tq7Vl31LRaGDLbsLAXKDT9KaU/W0ayQxBFkufajn8MknQ SSLLfjwi9z94+U1tj3UC0x5GNDmo5myIGLfhHurf/eqrVF3luVSB8eaxalQd7gQNQ0cF VqBIPKzil3Q1QXyI0dVZ44KQ8lrtIf+5XG71UWxo4o+SYVDhUrrV1y1YE0ZyzGXwuqmV +luRZTa+kDsOv8OXuB0CKewgyXvYwkrex3Ff85L+98H8xyeYvcbzLtVgbVOAIq/LwqHU rLTZrtCzmDHCSPofEW22ZQ1uaQx7xVQ8nJ50+t+exrhc+dpyGdw4YWyDRPIHeqijudLt 0o9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=akCZ6cl2; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w5si697881ejz.607.2021.04.14.17.49.38; Wed, 14 Apr 2021 17:50:01 -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; dkim=pass header.i=@chromium.org header.s=google header.b=akCZ6cl2; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231641AbhDNVSh (ORCPT + 99 others); Wed, 14 Apr 2021 17:18:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231461AbhDNVSg (ORCPT ); Wed, 14 Apr 2021 17:18:36 -0400 Received: from mail-vs1-xe35.google.com (mail-vs1-xe35.google.com [IPv6:2607:f8b0:4864:20::e35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37ABBC061574 for ; Wed, 14 Apr 2021 14:18:14 -0700 (PDT) Received: by mail-vs1-xe35.google.com with SMTP id k124so11098414vsk.3 for ; Wed, 14 Apr 2021 14:18:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=HSRWSjJIyTOfOO8D771rBsEaBLI9bpiKOdKKIXVQ4CQ=; b=akCZ6cl2eKyt+LPsYu0lXcStEvNjyEYweD9QTez7knontom444UNX1fyj0tpxD2IRP gZzB+zzZ2FAkILUStIAqPiPT0vyr/SCDnavdE+73jzATEe/zFOL0Ol7XdP97K2aWdnW7 ifT1Do9UcX1ufZ1wuYOwFfGLwGMFsLJFlPMmU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=HSRWSjJIyTOfOO8D771rBsEaBLI9bpiKOdKKIXVQ4CQ=; b=U/XwFeoRAumtv4Rav9PllASAey0j/OkrswFV45hGeD3Agj6bDKCwOkRidVMobqtDrC 0sLC05uXA6HZN2vObt0bnppM0JsJuPsawJSmL775QVmkKnZQZg9BE2p4PFUZTs/yQse9 YC52OP+SkguHeZRMeY5M3RvwSJy08U0rl1N02XB4KImhO8/8vBPbMNAGrZnl0y9VGQnX uxvCmzb1zEhkhH0Tvudpng+Y1F5HFMRHYzNTf8xl/8Rd1NcnllF7ydAclPqOCzVOyalR /ahBUfMqR0msu6sIe5aPKs6Hg9msdUnS9i1pZI7SmlTP1LQAdt9k1jab1DOqiJStwgta 8LWQ== X-Gm-Message-State: AOAM533z58hx5TJxJXxJapsQHg43+z4MBP3fGN8C5rgX7aAV+IIIRWEx S5hEKDdUwRMmOOftJUzdyghtzC/FQCznirqjF+AV0w== X-Received: by 2002:a67:c88f:: with SMTP id v15mr242466vsk.31.1618435092886; Wed, 14 Apr 2021 14:18:12 -0700 (PDT) MIME-Version: 1.0 References: <20210326035035.3057800-1-jwerner@chromium.org> In-Reply-To: <20210326035035.3057800-1-jwerner@chromium.org> From: Julius Werner Date: Wed, 14 Apr 2021 14:18:01 -0700 Message-ID: Subject: Re: [PATCH 0/3] Detect suspicious indentation after conditional To: Julius Werner Cc: Andy Whitcroft , Joe Perches , Ivo Sieben , LKML Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org *friendly ping* Hi Andy, Joe, Any comments on this patch series? Are you guys the right point of contact for checkpatch changes? On Thu, Mar 25, 2021 at 8:50 PM Julius Werner wrote: > > This patch series is adding functionality to checkpatch.pl to test for > incorrect code indentation after a conditional statement, like this: > > if (a) > b; > c; > > (Indentation implies that `c;` was guarded by the conditional, but it > isn't.) The main part is re-sending a patch from Ivo Sieben that was > already proposed in 2014 [1]. I don't know why it was never merged -- > it seems that there was no discussion on it. I hope that it was only > overlooked, because it works great, and I think this is a very important > class of common error to catch. > > I have tested it extensively on the kernel tree and in the course of > that found a few more edge cases that get fixed by the other two > patches. With all these applied, the vast majority of hits I get from > this check on the kernel tree are actual indentation errors or other > code style violations (e.g. case label and statement on the same line). > The only significant remaining group of false positives I found are > cases of macros being defined within a function, which are overall very > rare. I think the benefit of adding this check would far outweigh the > remaining amount of noise. > > [1]: https://lore.kernel.org/patchwork/patch/465116 > > Ivo Sieben (1): > Suspicious indentation detection after conditional statement > > Julius Werner (2): > checkpatch: ctx_statement_block: Fix preprocessor guard tracking > checkpatch: Ignore labels when checking indentation > > scripts/checkpatch.pl | 56 +++++++++++++++++++++++++++++++++++++++---- > 1 file changed, 52 insertions(+), 4 deletions(-) > > -- > 2.29.2 >