Re: [PATCH] staging: pi433: remove unnecessary new line escape sequence characters

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Jan 30, 2022 at 07:18:26PM +1300, Paulo Miguel Almeida wrote:
> In this driver there were occurences of '\n'-ended strings when using
> dev_dbg function which isn't required which most likely were leftovers
> from a previous printk/pr_<level> implementation.
> 
> This patch removes the extraneous '\n' characters to make it consistent
> with the other dev_dbg instances.
> 
> Signed-off-by: Paulo Miguel Almeida <paulo.miguel.almeida.rodenas@xxxxxxxxx>
> ---
> Patch dependencies:
> 
> The following patches must be applied first given that changes are made
> to the same set of files:
> 
> - https://lore.kernel.org/lkml/YfYdVokxsQ+Adl+T@xxxxxxxxxxxxxxx/
> - https://lore.kernel.org/lkml/YfX+llwDWZZMz+NY@xxxxxxxxxxxxxxx/
> ---
>  drivers/staging/pi433/pi433_if.c | 14 +++++++-------
>  drivers/staging/pi433/rf69.c     | 16 ++++++++--------
>  2 files changed, 15 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/staging/pi433/pi433_if.c b/drivers/staging/pi433/pi433_if.c
> index 02d4ccebf..db1b092e8 100644
> --- a/drivers/staging/pi433/pi433_if.c
> +++ b/drivers/staging/pi433/pi433_if.c
> @@ -124,13 +124,13 @@ static irqreturn_t DIO0_irq_handler(int irq, void *dev_id)
>  
>  	if (device->irq_state[DIO0] == DIO_PACKET_SENT) {
>  		device->free_in_fifo = FIFO_SIZE;
> -		dev_dbg(device->dev, "DIO0 irq: Packet sent\n");
> +		dev_dbg(device->dev, "DIO0 irq: Packet sent");

Both the old and new code will do the same thing.  You are correct.
However in terms of style, I believe the preference is to add a newline.

I don't remember the reasoning behind this.  But a lot of these style
rules are just decided by consensus.  If you do a
`git grep -w dev_dbg | grep \;$` then it is 12391 places that add a
new line and 622 which don't.  Adding a newline is the clear winner.

regards,
dan carpenter





[Index of Archives]     [Linux Driver Development]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux