From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 081B1C5519F for ; Sat, 21 Nov 2020 20:05:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C272222201 for ; Sat, 21 Nov 2020 20:05:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728463AbgKUUF0 (ORCPT ); Sat, 21 Nov 2020 15:05:26 -0500 Received: from smtprelay0115.hostedemail.com ([216.40.44.115]:60790 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728402AbgKUUFZ (ORCPT ); Sat, 21 Nov 2020 15:05:25 -0500 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay08.hostedemail.com (Postfix) with ESMTP id B2461182CED28; Sat, 21 Nov 2020 20:05:24 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-HE-Tag: clam12_3c079d827356 X-Filterd-Recvd-Size: 1784 Received: from XPS-9350.home (unknown [47.151.128.180]) (Authenticated sender: joe@perches.com) by omf18.hostedemail.com (Postfix) with ESMTPA; Sat, 21 Nov 2020 20:05:23 +0000 (UTC) Message-ID: <185d4505b35be4b9d039f430b3f95e7c33ed6a49.camel@perches.com> Subject: Re: [PATCH] checkpatch: add --fix option for INCLUDE_LINUX From: Joe Perches To: Dwaipayan Ray Cc: linux-kernel-mentees@lists.linuxfoundation.org, linux-kernel@vger.kernel.org, lukas.bulwahn@gmail.com Date: Sat, 21 Nov 2020 12:05:22 -0800 In-Reply-To: <20201121161706.104631-1-dwaipayanray1@gmail.com> References: <20201121161706.104631-1-dwaipayanray1@gmail.com> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.38.1-1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 2020-11-21 at 21:47 +0530, Dwaipayan Ray wrote: > Provide fix option to INCLUDE_LINUX check to replace asm > includes. > > Macros of type: >  #include > > are corrected to: >  #include [] > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl [] > @@ -5468,8 +5468,11 @@ sub process { >   CHK("ARCH_INCLUDE_LINUX", >   "Consider using #include instead of \n" . $herecurr); >   } else { > - WARN("INCLUDE_LINUX", > - "Use #include instead of \n" . $herecurr); > + if (WARN("INCLUDE_LINUX", > + "Use #include instead of \n" . $herecurr) && > + $fix) { > + $fixed[$fixlinenr] =~ s/\/\/; $file can include a slash. e.g.: arch/arm/kernel/atags_parse.c:#include Probably simpler to use /Q /E quoting.