Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp963012rwb; Tue, 27 Sep 2022 06:51:34 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7CPLh0G0rMdwf5uyanhX2zU3h77LYkpE2JcxIkx4AdQVHDWuaf+/nEJCrZEsJe47eHY+cM X-Received: by 2002:a17:90b:3148:b0:203:41c:2124 with SMTP id ip8-20020a17090b314800b00203041c2124mr4494327pjb.223.1664286693811; Tue, 27 Sep 2022 06:51:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664286693; cv=none; d=google.com; s=arc-20160816; b=VqvuyR7Md8CwprMA0dUb2dsMzDkw/p0uZp76ez8vlusxGENLZudvPijbmp0ADgWtIx Opr2T0tSmLHR+nhYn1Z4yZyGypWxZQ7r1Wp/+FJL0GRAz0OzMZd3FzHwYCtNj4RyqtNi KptNy3oPGw61Co5vCg7npcST8g/qCQgfFFMbPCzyi1IUBrGJs9Gfr8EtmaBR29S2F3nv yS0iARTeGhjTNbM4BM7uAJDBJ+f2Bxcrac1qUfXfM+F4IS6h05aKDCzIuydnVV+/bsFZ b4MV7lrZQr9qnrcJjY34HJ5N+M/LSWRrwbKNgF+4Q6HzTSO71YtZ+NZxUw14X5Kh8zP8 TbPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=T4DFeRR+9rcOHYzu4g9wngMAn89hl8Fco0xfzqAV7po=; b=cwmV6XSVdUHq3FevgXV4EI19Vepj7OOYNemH/NX04quRbIqVlHNPlFMfNouw4aVKHE EfgEltr+pFqZ22Pi6aNWE9J1BxMmvauJZgArs0AVVGxpVN2/sIgf6siVafOj7jF6N4Qj SYnDIJuUMXNddl1xFoKm/bcxvm3XZITksXakkTvBpGAGkxGlPqm+0pXI72GBuWxLA9fb s7tPGlPDQQyk4vh0yLC7zH91NJ+pkkkVYHKT+H0IVwQ55dTRCSrlyZZjeHaHceRGvHXe FkwN1rfLlvENZgYT7JOsGsEMOIpgWEbgs9baGhHDxaile3BFFE7z9NubVIr5lqiYkiAA 2uOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bRILjhA3; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o20-20020a635d54000000b0043980f3cf36si2217533pgm.602.2022.09.27.06.51.22; Tue, 27 Sep 2022 06:51:33 -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=@kernel.org header.s=k20201202 header.b=bRILjhA3; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232599AbiI0NUe (ORCPT + 99 others); Tue, 27 Sep 2022 09:20:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231174AbiI0NTJ (ORCPT ); Tue, 27 Sep 2022 09:19:09 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A80818D0E8; Tue, 27 Sep 2022 06:17:32 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2F5CE61948; Tue, 27 Sep 2022 13:17:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 44256C433D6; Tue, 27 Sep 2022 13:17:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1664284627; bh=hX3CkUKsKLDVWEC17HcIKLgPdwRhk2yS/LDQoYcnPnE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bRILjhA3TPvzVf33OI9eCns81BmwnAc9vVP28r9Ppt+pneIV0AkyAmKLmNnJsY53R dMnJQ3HvpXI/jD6zgvoiiixn338BCTX++V0nS/2ew+y1Bnapu+kgDSJwkQ5WWGzPC8 NtEswBzBALZNCri1un+KHB4f2PgTch5A20MqOrqPrR9x1Gtw6jCxOQ9yWsrHwC+kuJ s/KG1QnC+1ftR+f6uXGaMCICOZX276trI+WL38RsDgaGeS2ZO2uwYiO7uHft4MnYzN s++ovNTnSbc7box+ZQUVV+LYalqR+b6WE5XPde1ZBnv8XFE84fhuzxY/xNsfbKAFS8 uvWdsDFcuw0PQ== From: Miguel Ojeda To: Linus Torvalds , Greg Kroah-Hartman Cc: rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, patches@lists.linux.dev, Jarkko Sakkinen , Miguel Ojeda , Kees Cook , Alex Gaynor , Wedson Almeida Filho , Andy Whitcroft , Joe Perches , Dwaipayan Ray , Lukas Bulwahn Subject: [PATCH v10 16/27] scripts: checkpatch: enable language-independent checks for Rust Date: Tue, 27 Sep 2022 15:14:47 +0200 Message-Id: <20220927131518.30000-17-ojeda@kernel.org> In-Reply-To: <20220927131518.30000-1-ojeda@kernel.org> References: <20220927131518.30000-1-ojeda@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 Include Rust in the "source code files" category, so that the language-independent tests are checked for Rust too, and teach `checkpatch` about the comment style for Rust files. This enables the malformed SPDX check, the misplaced SPDX license tag check, the long line checks, the lines without a newline check and the embedded filename check. Reviewed-by: Kees Cook Co-developed-by: Alex Gaynor Signed-off-by: Alex Gaynor Co-developed-by: Wedson Almeida Filho Signed-off-by: Wedson Almeida Filho Signed-off-by: Miguel Ojeda --- scripts/checkpatch.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 74a769310adf..b5ed31d631fa 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -3616,7 +3616,7 @@ sub process { my $comment = ""; if ($realfile =~ /\.(h|s|S)$/) { $comment = '/*'; - } elsif ($realfile =~ /\.(c|dts|dtsi)$/) { + } elsif ($realfile =~ /\.(c|rs|dts|dtsi)$/) { $comment = '//'; } elsif (($checklicenseline == 2) || $realfile =~ /\.(sh|pl|py|awk|tc|yaml)$/) { $comment = '#'; @@ -3664,7 +3664,7 @@ sub process { } # check we are in a valid source file if not then ignore this hunk - next if ($realfile !~ /\.(h|c|s|S|sh|dtsi|dts)$/); + next if ($realfile !~ /\.(h|c|rs|s|S|sh|dtsi|dts)$/); # check for using SPDX-License-Identifier on the wrong line number if ($realline != $checklicenseline && -- 2.37.3