Re: [PATCH v2] checkpatch: report warning with files ending with blank lines
From: Joe Perches
Date: Wed Oct 07 2026 - 14:33:32 EST
On Wed, 2026-10-07 at 19:54 +0200, Christian Marangi wrote:
> Yes if you think about this, this will read the last line of the .patch,
> not the last line of a new file that will be generated by the .patch.
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 70a11f2ff61d..0b9946c532af 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -785,3 +785,9 @@ S: Maintained
> F: Documentation/devicetree/bindings/spi/airoha,en7581-snand.yaml
> F: drivers/spi/spi-airoha-snfi.c
>
> +AIROHA USB PHY DRIVER
> +M: Christian Marangi <[ansuelsmth@xxxxxxxxx](mailto:ansuelsmth@xxxxxxxxx)>
> +L: [linux-arm-kernel@xxxxxxxxxxxxxxxxxxx](mailto:linux-arm-kernel@xxxxxxxxxxxxxxxxxxx) (moderated for non-subscribers)
> +S: Maintained
> +F: Documentation/devicetree/bindings/phy/airoha,an7581-usb-phy.yaml
> +
> --
> 2.55.0
>
> It's to catch situation like this. Example for entire new file or adding
> stuff at the end of a file, where a new line is introduced.
>
> git am will complain about this.
It seems there's something odd about the patch content
as there aren't any context lines after the addition.
How was it generated ?