From nobody Wed Apr 8 15:55:32 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D8970FA3740 for ; Thu, 27 Oct 2022 13:43:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234100AbiJ0Nnm (ORCPT ); Thu, 27 Oct 2022 09:43:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233403AbiJ0Nnj (ORCPT ); Thu, 27 Oct 2022 09:43:39 -0400 Received: from mx4.wp.pl (mx4.wp.pl [212.77.101.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C5558101192 for ; Thu, 27 Oct 2022 06:43:37 -0700 (PDT) Received: (wp-smtpd smtp.wp.pl 21206 invoked from network); 27 Oct 2022 15:43:34 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wp.pl; s=1024a; t=1666878214; bh=0jTZuFMOet0/Mkh7blWo8IBP2mkifDuxnD2liUJEdLI=; h=From:To:Cc:Subject; b=PH7P4e85jPsp92b4BrWX9Bd3o1Dx4MILCfGYxKmr2Z3jU1tNzC9WbCdSCgydcUsM5 oYDRXw5WayBJmlbOC0it5tEPs/EV4KvqZj9I6gkaAFJU1elyILlAjKd8/8y9CaynKj TloCMQkh0/VePtRXkaMUQPNuREdaR4oCIAYJ03XM= Received: from 89-64-7-202.dynamic.chello.pl (HELO localhost) (stf_xl@wp.pl@[89.64.7.202]) (envelope-sender ) by smtp.wp.pl (WP-SMTPD) with ECDHE-RSA-AES256-GCM-SHA384 encrypted SMTP for ; 27 Oct 2022 15:43:34 +0200 From: Stanislaw Gruszka To: Andrew Morton , Joe Perches , Andy Whitcroft Cc: Dwaipayan Ray , Lukas Bulwahn , linux-kernel@vger.kernel.org Subject: [PATCH v2] scripts: checkpatch: allow "case" macros Date: Thu, 27 Oct 2022 15:43:34 +0200 Message-Id: <20221027134334.164301-1-stf_xl@wp.pl> X-Mailer: git-send-email 2.25.4 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-WP-MailID: 15cd002cc8fdabecd2e0a63b415f080c X-WP-AV: skaner antywirusowy Poczty Wirtualnej Polski X-WP-SPAM: NO 000000B [wcOE] Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Do not report errors like below: ./scripts/checkpatch.pl -f drivers/net/wireless/ath/ath10k/wmi.h ERROR: Macros with complex values should be enclosed in parentheses +#define C2S(x) case x: return #x since many "case ..." macros are already used by some in-kernel drivers. Signed-off-by: Stanislaw Gruszka Acked-by: Joe Perches --- scripts/checkpatch.pl | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 1e5e66ae5a52..4b888b1313d5 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -5901,6 +5901,7 @@ sub process { $dstat !~ /$exceptions/ && $dstat !~ /^\.$Ident\s*=3D/ && # .foo =3D $dstat !~ /^(?:\#\s*$Ident|\#\s*$Constant)\s*$/ && # stringificati= on #foo + $dstat !~ /^case\b/ && # case ... $dstat !~ /^do\s*$Constant\s*while\s*$Constant;?$/ && # do {...} wh= ile (...); // do {...} while (...) $dstat !~ /^while\s*$Constant\s*$Constant\s*$/ && # while (...) {.= ..} $dstat !~ /^for\s*$Constant$/ && # for (...) --=20 2.25.4