lkml.org 
[lkml]   [2022]   [Jan]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] staging: pi433: remove unnecessary new line escape sequence characters
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@gmail.com>
> ---
> 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@mail.google.com/
> - https://lore.kernel.org/lkml/YfX+llwDWZZMz+NY@mail.google.com/
> ---
> 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

\
 
 \ /
  Last update: 2022-01-31 11:41    [W:0.043 / U:0.376 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site