Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1892168lqp; Tue, 16 Apr 2024 00:19:07 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUm6bGTy4KkJMkt7mQiYWMDP7QoAhTYu1i1ck+84skVRcPMmCHX0EDww66SJs03oIuE77fauTz1VRec2AHk7JwJ6u4a7WwWF6iZjhj5AA== X-Google-Smtp-Source: AGHT+IFnCTyDCaRWtp3hG3Pr/hEaGnElsEL/yLFUtoT6O1MuANeBaWTwpleHoownzoMjY4UwJhyY X-Received: by 2002:a05:6a20:3cab:b0:1a9:97fb:40cc with SMTP id b43-20020a056a203cab00b001a997fb40ccmr12195232pzj.2.1713251947660; Tue, 16 Apr 2024 00:19:07 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713251947; cv=pass; d=google.com; s=arc-20160816; b=gws/tYehgs1o7X4c+l3Di1Ot27lAR+KHc5ZYiHk2zcN3fah178FDNDtkLLipCIoE6l m0lQrtBPPpkZnXoV2QLsSDeZ13VReykHeapq2jVyNWypQWUOQhgtXDcoxHtajXurDoM2 6j5SQOirKgi9/dGdWN77HNwB+vkjwrixZhxWWq/uPcGZ8dwD4+jYxWwVYGwY2/Cit2w0 xtve8Go0g1Hy8nnOr++Q19as8Fr4II/C9gXVvRI+ISDJUy81scQjoXgNzwAv/PDbeVDX FV3xxbPhOEOUSp33vlrWnN/XdQXnf4UNuW8xOowSHiGm8oSn+gcm6wdHWnlLSGegTmX4 UseQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:subject:references:in-reply-to :message-id:cc:to:reply-to:from:date:dkim-signature; bh=qCnQDVa7gcBj72tko08cbYB/OWz9xGb3hgKYoiVKajc=; fh=X+BJwtMBZtbBMvQkyPwahYQvmbZ5hSTSrFQ/m8CKxH0=; b=E3bKouaZDwTUEc35jH6nV2KpkCuNM0NrjCSAjw4X6Zfqjn30UEAEAiQrH+MZQcy/4J 5phBkBL1EZMZe+GAu/GTnxkjm0/ajLAZyIFqKOblCzg3Bs0Gg4vpAxEW12MshkSyd1Ax UCGZBkTQvlKmkZxeJzvR+gsKd1L+6t+9rohTpfPBlR8S0BQiCKR5YozWlAoJEksY+MQ8 29kmjNiklyLgPfZLO77sCo+8Pa4t9WeZX/B9tjRVbyAfNPF1a9KaigIMNTSclHPWr6jj p66VFuxrWlnFO1q0mnYJ2PpKnpWtQWvyKsnJhS1Cin59lGGp3uCraZQ7QReS9vB9rd4N G+Gw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@yahoo.com header.s=s2048 header.b=GLtrmbVV; arc=pass (i=1 dkim=pass dkdomain=yahoo.com); spf=pass (google.com: domain of linux-kernel+bounces-146404-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-146404-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=fedoraproject.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id lp3-20020a056a003d4300b006edabe82a75si9653063pfb.137.2024.04.16.00.19.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Apr 2024 00:19:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-146404-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@yahoo.com header.s=s2048 header.b=GLtrmbVV; arc=pass (i=1 dkim=pass dkdomain=yahoo.com); spf=pass (google.com: domain of linux-kernel+bounces-146404-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-146404-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=fedoraproject.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 5215C2810F9 for ; Tue, 16 Apr 2024 07:19:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B9347156979; Tue, 16 Apr 2024 07:16:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=yahoo.com header.i=@yahoo.com header.b="GLtrmbVV" Received: from sonic310-19.consmr.mail.sg3.yahoo.com (sonic310-19.consmr.mail.sg3.yahoo.com [106.10.244.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D1C7978C68 for ; Tue, 16 Apr 2024 07:16:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=106.10.244.139 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713251764; cv=none; b=vGTJuJJPXzrH482zW9OhJmsrK8EGzOdiSCbXwdqHqbh7ZjJAX2BlTSCkFhUdXZkuOf0rwv4W6269WKHpP0emT+QOqmzyde1zuN3koAB83Eife/gePXx9fGBWRxCARLY2pC1pAqzxSEEbha+XEvG0HqZBrY/3+Fen0jx1pU1HprY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713251764; c=relaxed/simple; bh=qCnQDVa7gcBj72tko08cbYB/OWz9xGb3hgKYoiVKajc=; h=Date:From:To:Cc:Message-ID:In-Reply-To:References:Subject: MIME-Version:Content-Type; b=M+j2A7GdMQEHHzF3DJ8igSJBUt0eE9LvGJ7ellKWKSCwKcL3G64lJgdUDEtZO6FYiS/wd2nDEC80D9wWndlYIYPYxxRCgQ36zOY0iZR22hNYct8JoeF1P+Jal0KW+o0Gr/EIpQVCZhTWIlL+kCDC09XVqmxIn4gfgTczl76ZfJI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=fedoraproject.org; spf=fail smtp.mailfrom=fedoraproject.org; dkim=pass (2048-bit key) header.d=yahoo.com header.i=@yahoo.com header.b=GLtrmbVV; arc=none smtp.client-ip=106.10.244.139 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=fedoraproject.org Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=fedoraproject.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1713251759; bh=qCnQDVa7gcBj72tko08cbYB/OWz9xGb3hgKYoiVKajc=; h=Date:From:Reply-To:To:Cc:In-Reply-To:References:Subject:From:Subject:Reply-To; b=GLtrmbVVR7o2jYDVNGIkcSX+Uh3I76K9btp+MquhuTBr2n7nIrD//Z9CvksOk3P1D/aipgUyXoZo2mRTjV0Mzmt1QKYVCrRX3uBmRsiS3XEi4vHJDAJ6YfT4lSu4+3Op1F/tYTtHE0TSCbZZt6rgI83er69xkSWMg8Le9UvZJyhHMHs/R+3IAZlnP0b+5hVjvgUBD5bdi701PclPNbuPbZoEqlCLjcaW6qFnoUmmNz/3sgP559+9OKp9qMYM4GOM+VwF1FSjtyHucTfZ+dqhbX3ukJq3Vsr0587NIAoPEQzKID97mRjG1hCojA9qilZLjVhtVnmUskPVNTKT5ClW7g== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1713251759; bh=G1siwvP4ph/WCnDCmSpi/3bZJziYzv3ib4WWxYObHzt=; h=X-Sonic-MF:Date:From:To:Subject:From:Subject; b=CVXXRB+fuFU2aNlvPUGN5j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jg KAIcEq.JnhVysHrBNy6ozw.K0gqk6MW2gDr7IjY10lRYXfcSD0RMDwoAZe4hxKqkChP4.u3suEZ2 KPQWOhrl_9g_IVnZ9d.VG.nisUD2k_7GHPxBAuWhm2PNt2pKCXgbZGKz8czMi4GHAdjpDg7EbpBu wwRUsPgIQhIpU_vRkNmvF9S6g8JVA86_luacNP_F99VjFRnNr1de_Cj3l2bhNrsHoQsHZ.bMH7JD nBJWL5tuTw15nQsj.FlmiOUwQnEIsWh7uGSZ8E.kiNQ5VzbIzh0KtYIZZ2Vke1e2fWkR74rBY5Cy jdIyZdPdapZZAy59tMQ64vs24MIjMAAR1McCaJix8DYmt0k5STL2lTTACRQhgkx4dbW58QkYLz71 UHT0UehFb.TFfPTi5YlLajTLrWn4G5WkQcQyr_RabQo1PVW1piPksovAMwxsVAYGNu3EVldl1JWP pYLWS4udc4cF6MQYm1xXrnzSxnLb1hMaeTgSOEioZt7r6IgbV3FSHVQyMHzWbNUmMFPO_nf2x X-Sonic-MF: X-Sonic-ID: 209efd66-4d69-40ed-b80b-1b3dc2d834a7 Received: from sonic.gate.mail.ne1.yahoo.com by sonic310.consmr.mail.sg3.yahoo.com with HTTP; Tue, 16 Apr 2024 07:15:59 +0000 Date: Tue, 16 Apr 2024 07:04:47 +0000 (UTC) From: Prasad Pandit Reply-To: Prasad Pandit To: "linux-kernel@vger.kernel.org" Cc: Joe Perches , Dwaipayan Ray , Lukas Bulwahn , Dan Carpenter , Greg KH , Andy Whitcroft Message-ID: <1568855168.5949322.1713251087824@mail.yahoo.com> In-Reply-To: <20240330033858.3272184-1-ppandit@redhat.com> References: <20240330033858.3272184-1-ppandit@redhat.com> Subject: Re: [PATCH] checkpatch: error if file terminates without a new-line Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Mailer: WebService/1.1.22205 YMailNorrin [+linux-kernel] On Saturday, 30 March, 2024 at 09:09:12 am IST, Prasad Pandit wrote:=C2=A0 From: Prasad Pandit Add check to flag an error if a patch terminates a file without a new line (\n) character. Suggested-by: Dan Carpenter Signed-off-by: Prasad Pandit --- scripts/checkpatch.pl | 7 +++++++ 1 file changed, 7 insertions(+) -> https://lore.kernel.org/all/CAE8KmOxG=3D3sWKpeB5fdWTK-SCipS=3DJyDE-_DNgY= --DtoSQZ0Qw@mail.gmail.com/T/#t diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 9c4c4a61bc83..df34c0709410 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -2795,6 +2795,13 @@ sub process { =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 $is_patch =3D 1; =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 } +# check if patch terminates file without a new line (\n) +=C2=A0 =C2=A0 =C2=A0 =C2=A0 if ($line =3D~ /^\\ No newline at end of file$= / +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 and $rawlines[$linenr - 2] =3D~ = /^\+.*$/) { +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ERROR("NOEOL_FILE", +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "patch term= inates file without a new line (\\n)."); +=C2=A0 =C2=A0 =C2=A0 =C2=A0 } + #extract the line range in the file after the patch is applied =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 if (!$in_commit_log && =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0 =C2=A0 $line =3D~ /^\@\@ -\d+(= ?:,\d+)? \+(\d+)(,(\d+))? \@\@(.*)/) { --=20 2.44.0