Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1924931lqp; Tue, 16 Apr 2024 01:48:41 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV9VW9+iw/8VQflYqIuuyC26HkRHCH0Uo2o7ketMk9Jr0ua4Imcl0+HCivQ7IHCyhTE6iPaA9U/DBR3rBt9A+ZYuj51SR5Tn/QANDmwCw== X-Google-Smtp-Source: AGHT+IG8Q905FqswqDLRPjO0MO+4u9h1a8Ljd2qKXcpxDEZ1pXOyUBS5MlkmvDHZbCK+IxqeII7N X-Received: by 2002:a05:620a:2904:b0:78e:c5d8:b891 with SMTP id m4-20020a05620a290400b0078ec5d8b891mr2470831qkp.30.1713257321001; Tue, 16 Apr 2024 01:48:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713257320; cv=pass; d=google.com; s=arc-20160816; b=gl7wVgGoryrSUpt0u9Om1QXpp+siXyturUiMD1OvFSBfWKT5GMHtlVMiDd6QMrRGed nm/jhbxIod/HQ+mYNHEK3NosFepnHMq0LrDYmFGGO3vYCHx828vGnabcwcYWoH3EVdMG H8/gVy2oaxEqFYRGndz6iY/+8d6DHHJgMQUYDlN1HGh8cziSzhiHmKpSLfl9cdBYAjmb /lTGdu1+lmovvPw259GrkXgWZ61gDMfjWVPVqAjtBeeXSncvGEfSmLWZ1Akq7958Go2C w4nTmYJnDx5fZ+sql/deBTIoscoH9MfVVq/gt9lkXEn++7MbNhEHL7iNxjw+4CKqdpyz ZeyA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=zsRIvTBBSAjNr/CMHLjTW6JFATDH9MYJkyqAlx3PaiQ=; fh=V2lTjAvAu6WRrfGSEf/26QDlkDaVIsG2+BdNI+cTH1g=; b=Yfz9Da6AUKxnUeTkvFX0vsBdGTFYMZUbQdM65Ove6yYgqa3JI3rL6tq7NIupZMEJsS PF9dm/XPt/nGa8+o6Lqhbifd0T3W6vFW5HwxW+iseGKLLPu2PCzVPFEDDwGBTHPTxVXI GCpEvz1rfxGAC7gry8JzGjKDMfPK7PdpicUBJOKo30EF8zfsF9FB2oy3IgbfHI6eOAkr /FE9zJBIXtY81jjqOSXS3nkfv7suZuTyEYfnbCTQjFn8fU0bXIrxnGigwuRqiAJlomxY o9flrkWK8MH7LKMADgmnbCanMzg0OvxVjnHrgy/3KBcxjc42OctBB1p9EyWZo8TF5zge rgjQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Xx2DwsPa; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-146513-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-146513-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id vr19-20020a05620a55b300b0078ebd8fd556si11791319qkn.172.2024.04.16.01.48.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Apr 2024 01:48:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-146513-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Xx2DwsPa; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-146513-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-146513-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id CD9D81C21636 for ; Tue, 16 Apr 2024 08:48:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C513183CDE; Tue, 16 Apr 2024 08:48:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="Xx2DwsPa" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C2C91629 for ; Tue, 16 Apr 2024 08:48:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713257310; cv=none; b=upMHfhIO6wJy8kcOWhNVvVMQY1VmhEMn16b6ZeZ9vRPyTnZh1XY4tIgGyDxhOWdo3jXa6h5WrX1pa4HQDOIZDk5ZAO4a141/dW3x9jS3CzOCndAW8+xhNqNiOzNbXOSiBDupwgte2f1uPdqjcVQCMratGEeexhBKl5Q//E2twp0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713257310; c=relaxed/simple; bh=V+oDn0QCdhCQ8aFwN1VCxY0M9KNpWGzlOPZFuRgwIKE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=p4tM1pjQcEOV5PwH3strerPFkxBSoVtfCFegX/rwX3girEgpkdSqe9pOJQInrr3odGPyBOHBqbQthPW4TSfNSWM6weOWiQTmfWobei1azWysJAkn9cnYCX79YYy6H/udw7fwPnzcHco8UELzYNB3pwr+G7WDZhGNE4RSkicX0Lc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Xx2DwsPa; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id EE58DC3277B; Tue, 16 Apr 2024 08:48:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1713257310; bh=V+oDn0QCdhCQ8aFwN1VCxY0M9KNpWGzlOPZFuRgwIKE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Xx2DwsPaaQX5+4GQ4gbxz+UmI2v2AcRc0WW7+xc4iLqaSwwQ9Vl5fUzvBWETjD382 54FHdwN16TqERSj26B4AJ7p7Idpwf8y5iDG5wy43eDmb1uv4EBcmNV4ZRl/bTJTESd MzaaTr1Y7quWkqpiLxUVJ0Ej/2a8atJ35Ylyy27A= Date: Tue, 16 Apr 2024 10:48:27 +0200 From: Greg KH To: Prasad Pandit Cc: "linux-kernel@vger.kernel.org" , Joe Perches , Dwaipayan Ray , Lukas Bulwahn , Dan Carpenter , Andy Whitcroft Subject: Re: [PATCH] checkpatch: error if file terminates without a new-line Message-ID: <2024041627-overgrown-ripping-2348@gregkh> References: <20240330033858.3272184-1-ppandit@redhat.com> <1568855168.5949322.1713251087824@mail.yahoo.com> 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=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1568855168.5949322.1713251087824@mail.yahoo.com> On Tue, Apr 16, 2024 at 07:04:47AM +0000, Prasad Pandit wrote: > [+linux-kernel] > > On Saturday, 30 March, 2024 at 09:09:12 am IST, Prasad Pandit wrote:? Why are these lines in a changelog of a patch to submit? That's not going to work :( I suggest taking some time and talking to some other kernel developers in red hat as to how to submit changes, that will make things much easier. > 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 Also, I see 3 different emails for you here, none of which match, pick one for kernel development and stick with it? > --- > scripts/checkpatch.pl | 7 +++++++ > 1 file changed, 7 insertions(+) > > -> https://lore.kernel.org/all/CAE8KmOxG=3sWKpeB5fdWTK-SCipS=JyDE-_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 { > ??? ??? ??? $is_patch = 1; > ??? ??? } > > +# check if patch terminates file without a new line (\n) > +? ? ? ? if ($line =~ /^\\ No newline at end of file$/ > +? ? ? ? ? ? and $rawlines[$linenr - 2] =~ /^\+.*$/) { > +? ? ? ? ? ? ERROR("NOEOL_FILE", > +? ? ? ? ? ? ? ? ? "patch terminates file without a new line (\\n)."); > +? ? ? ? } Why is this a problem? files without a new line should not cause problems with a compiler, right? You don't have a justification for why this change needs to be checked for anywhere. thanks, greg k-h