lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220131104020.GI1951@kadam>
Date:   Mon, 31 Jan 2022 13:40:20 +0300
From:   Dan Carpenter <dan.carpenter@...cle.com>
To:     Paulo Miguel Almeida <paulo.miguel.almeida.rodenas@...il.com>
Cc:     gregkh@...uxfoundation.org, realwakka@...il.com,
        linux-staging@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: Re: [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@...il.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ