From: Dan Carpenter <dan.carpenter@oracle.com>
To: Paulo Miguel Almeida <paulo.miguel.almeida.rodenas@gmail.com>
Cc: gregkh@linuxfoundation.org, realwakka@gmail.com,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: pi433: remove unnecessary new line escape sequence characters
Date: Mon, 31 Jan 2022 13:40:20 +0300 [thread overview]
Message-ID: <20220131104020.GI1951@kadam> (raw)
In-Reply-To: <YfYtsiKbOXghIN+5@mail.google.com>
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
next prev parent reply other threads:[~2022-01-31 10:40 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-30 6:18 [PATCH] staging: pi433: remove unnecessary new line escape sequence characters Paulo Miguel Almeida
2022-01-31 10:40 ` Dan Carpenter [this message]
2022-01-31 19:30 ` Paulo Miguel Almeida
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=20220131104020.GI1951@kadam \
--to=dan.carpenter@oracle.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=paulo.miguel.almeida.rodenas@gmail.com \
--cc=realwakka@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.