Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3588343pxb; Mon, 16 Nov 2020 20:24:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJyb5nVN41RgZUIh2Jz29/EHpT8i10aNiFvL5VTwQIen2JxPETHJOnshJcRi5XMHoJqunJcl X-Received: by 2002:a17:906:c357:: with SMTP id ci23mr16876174ejb.311.1605587089915; Mon, 16 Nov 2020 20:24:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605587089; cv=none; d=google.com; s=arc-20160816; b=SOMp6lH3eniDNdwnb4eQhGK+Yes6zRd/iqMlRpVM/pISyuU+v7a+mDOckFf+LpWHuf WWUUD+FiVldFWDUP086jon5tizVT2TXHdFJPi/CbUJT8ztI7WUjQYwX3ipBwG6pN4Hs/ QV9T1Pq0t+dyV6/4quDuXbhE2bvNC/0Ew/gHmY0UkIkE8+JzKy+7SkYw3oLZr8/Wr98t /kc09R81FtzirLKPdEGp0ksnFvo3147H5fVCpHocaZGRAoCWAUVJwQQAxEokIro5aujA pGxlmZwpkjQ9fZlDbtvuyymDmtLqEepHft9k0tp4hU1Sh+ka+kKBidaB7L/5cPHVWMJq Uq8A== 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 :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=aitFb2SpB/AqdAGseW/NBGpRghn7DqDhrR4s/0fk3TQ=; b=Zedd5zsA3ggjrACXotycrmfHyWhgMBL1QnbkdDkLTlHKAxw644f6UzKpoXjBV6zKe6 bv894GrGPAbMCo/I3/0rq8ABBMgcEfinP6V0IVgeQ/zDQfeZ3oyd5j0JyRXDMhlOLAXa DiI+SX/i7jDQKkxWmDx6ETpU9d7rEDTUcYJjdc16wsBaZJripPvyOEktvL6i7gyp2tpd OaKQjAfq1zowyE+8Ur1hGk7s1bYF8BHyzm5gI/HCHSI1aRAWMd1ycbiDnIJ1DpzcUM/Y 8HFAA+q7WIrNeesQ71C7QryVz7KCDAcl3an0lx2knvN9qtKWTQQSnp5pYKOL+Hs3l7Ps fo4g== 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 e10si12116550ejl.139.2020.11.16.20.24.26; Mon, 16 Nov 2020 20:24:49 -0800 (PST) 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 S1726938AbgKQEUp (ORCPT + 99 others); Mon, 16 Nov 2020 23:20:45 -0500 Received: from smtprelay0039.hostedemail.com ([216.40.44.39]:33848 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726826AbgKQEUp (ORCPT ); Mon, 16 Nov 2020 23:20:45 -0500 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay03.hostedemail.com (Postfix) with ESMTP id 83C7A837F24A; Tue, 17 Nov 2020 04:20:44 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 90,9,0,,d41d8cd98f00b204,joe@perches.com,,RULES_HIT:41:355:379:599:800:960:973:982:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1542:1593:1594:1711:1730:1747:1777:1792:2198:2199:2393:2559:2562:2689:2731:2828:3138:3139:3140:3141:3142:3354:3622:3653:3865:3867:3868:3870:4321:4362:5007:6119:7514:7875:7903:9010:10004:10400:10848:11232:11658:11914:12297:12555:12740:12895:13095:13439:13894:14181:14659:14721:21080:21433:21451:21627:21740:21741:21939:30054:30070:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:1,LUA_SUMMARY:none X-HE-Tag: birth03_35059fb2732e X-Filterd-Recvd-Size: 3269 Received: from XPS-9350.home (unknown [47.151.133.149]) (Authenticated sender: joe@perches.com) by omf19.hostedemail.com (Postfix) with ESMTPA; Tue, 17 Nov 2020 04:20:43 +0000 (UTC) Message-ID: <477496bed101ed007e7e8db6d511ece2fa2d119c.camel@perches.com> Subject: Re: [PATCH v3] checkpatch: add fix option for MAINTAINERS_STYLE From: Joe Perches To: Aditya Srivastava , Andrew Morton Cc: linux-kernel-mentees@lists.linuxfoundation.org, linux-kernel@vger.kernel.org, lukas.bulwahn@gmail.com Date: Mon, 16 Nov 2020 20:20:42 -0800 In-Reply-To: <20201117040501.21914-1-yashsri421@gmail.com> References: <20201117040501.21914-1-yashsri421@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 Tue, 2020-11-17 at 09:35 +0530, Aditya Srivastava wrote: > Checkpatch expects entries in MAINTAINERS file in a specific order and > warns if the changes made do not follow the specified order. > > E.g., running checkpatch on commit b33bc2b878e0 ("nexthop: Add entry to > MAINTAINERS") reports this warning: > > WARNING: Misordered MAINTAINERS entry - list file patterns in > alphabetic order > +F: include/uapi/linux/nexthop.h > +F: include/net/netns/nexthop.h OK, this should work. Thanks Aditya. Acked-by: Joe Perches > > Provide a simple fix by swapping the unordered lines, if both the lines > are additions (start with '+') > > Signed-off-by: Aditya Srivastava > --- > Changes in v2: > modified commit message > > Changes in v3: > add check if both the lines are additions(ie start with '+') > > ?scripts/checkpatch.pl | 17 +++++++++++++---- > ?1 file changed, 13 insertions(+), 4 deletions(-) > > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl > index 2749f32dffe9..7ee3f05c354d 100755 > --- a/scripts/checkpatch.pl > +++ b/scripts/checkpatch.pl > @@ -3299,13 +3299,22 @@ sub process { > ? "Unknown MAINTAINERS entry type: '$cur'\n" . $herecurr); > ? } else { > ? if ($previndex >= 0 && $curindex < $previndex) { > - WARN("MAINTAINERS_STYLE", > - "Misordered MAINTAINERS entry - list '$cur:' before '$prev:'\n" . $hereprev); > + if (WARN("MAINTAINERS_STYLE", > + "Misordered MAINTAINERS entry - list '$cur:' before '$prev:'\n" . $hereprev) && > + $fix && $prevrawline =~ /^\+[A-Z]:/) { > + # swap these lines > + $fixed[$fixlinenr - 1] = $rawline; > + $fixed[$fixlinenr] = $prevrawline; > + } > ? } elsif ((($prev eq 'F' && $cur eq 'F') || > ? ($prev eq 'X' && $cur eq 'X')) && > ? ($prevval cmp $curval) > 0) { > - WARN("MAINTAINERS_STYLE", > - "Misordered MAINTAINERS entry - list file patterns in alphabetic order\n" . $hereprev); > + if (WARN("MAINTAINERS_STYLE", > + "Misordered MAINTAINERS entry - list file patterns in alphabetic order\n" . $hereprev) && > + $fix && $prevrawline =~ /^\+[A-Z]:/) { > + $fixed[$fixlinenr - 1] = $rawline; > + $fixed[$fixlinenr] = $prevrawline; > + } > ? } > ? } > ? }