From: Joe Perches <joe@perches.com>
To: Christian Marangi <ansuelsmth@gmail.com>,
Vinod Koul <vkoul@kernel.org>, Andy Whitcroft <apw@canonical.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] checkpatch: report warning with files ending with blank lines
Date: Tue, 06 Oct 2026 10:46:45 -0700 [thread overview]
Message-ID: <be20c5a1617c7c5639a06d8d03e689541d359d95.camel@perches.com> (raw)
In-Reply-To: <20261006102119.7695-1-ansuelsmth@gmail.com>
On Tue, 2026-10-06 at 12:21 +0200, Christian Marangi wrote:
> On applying patch, git, depending on the default configuration, might
> complain for any file having blank lines at end of file.
>
> These blank lines can go unnotice by the patch submitter as they are not
> reported by checkpatch.pl with the maintainer only noticing the error when
> the patch is applied. This result in the submitter getting confused asking
> further info to the maintainer making the review process longer.
>
> To address this, add a simple logic to catch this error and report as
> warning. Example:
>
> WARNING: blank line at end of file
> 102: FILE: Documentation/devicetree/bindings/phy/airoha,an7581-usb-phy.yaml:62:
> + };
> +
While this might be a good idea, the placement
of this test is probably not good at the start
of the process() block.
I'd place it so it's only checked once at the
end of the process() block after all the rest
of the lines are tested.
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
[]
> +# Check for blank line at end of file
[]
etc...
prev parent reply other threads:[~2026-10-06 17:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-06 10:21 Christian Marangi
2026-10-06 17:46 ` Joe Perches [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=be20c5a1617c7c5639a06d8d03e689541d359d95.camel@perches.com \
--to=joe@perches.com \
--cc=ansuelsmth@gmail.com \
--cc=apw@canonical.com \
--cc=linux-kernel@vger.kernel.org \
--cc=vkoul@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®