From: Leon Romanovsky <leon@kernel.org>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>,
"davem@davemloft.net" <davem@davemloft.net>,
"edumazet@google.com" <edumazet@google.com>,
"kuba@kernel.org" <kuba@kernel.org>,
"pabeni@redhat.com" <pabeni@redhat.com>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"linux-renesas-soc@vger.kernel.org"
<linux-renesas-soc@vger.kernel.org>,
Dan Carpenter <error27@gmail.com>,
Geert Uytterhoeven <geert+renesas@glider.be>
Subject: Re: [PATCH] net: ethernet: renesas: rswitch: Fix MAC address info
Date: Thu, 17 Nov 2022 12:54:21 +0200 [thread overview]
Message-ID: <Y3YS3Q8WqtWalsAf@unreal> (raw)
In-Reply-To: <CAMuHMdV2feBGX1tjrGu-gzq_MwfVRS5OHY9V+=wOe_q-E2VkTg@mail.gmail.com>
On Thu, Nov 17, 2022 at 10:38:16AM +0100, Geert Uytterhoeven wrote:
> Hi Leon,
>
> On Thu, Nov 17, 2022 at 10:14 AM Leon Romanovsky <leon@kernel.org> wrote:
> > On Thu, Nov 17, 2022 at 09:59:55AM +0100, Geert Uytterhoeven wrote:
> > > On Thu, Nov 17, 2022 at 9:58 AM Yoshihiro Shimoda
> > > <yoshihiro.shimoda.uh@renesas.com> wrote:
> > > > > From: Leon Romanovsky, Sent: Thursday, November 17, 2022 3:09 PM
> > > > > > --- a/drivers/net/ethernet/renesas/rswitch.c
> > > > > > +++ b/drivers/net/ethernet/renesas/rswitch.c
> > > > > > @@ -1714,7 +1714,7 @@ static int rswitch_init(struct rswitch_private *priv)
> > > > > > }
> > > > > >
> > > > > > for (i = 0; i < RSWITCH_NUM_PORTS; i++)
> > > > > > - netdev_info(priv->rdev[i]->ndev, "MAC address %pMn",
> > > > > > + netdev_info(priv->rdev[i]->ndev, "MAC address %pM\n",
> > > > >
> > > > > You can safely drop '\n' from here. It is not needed while printing one
> > > > > line.
> > > >
> > > > Oh, I didn't know that. I'll remove '\n' from here on v2 patch.
> > >
> > > Please don't remove it. The convention is to have the newlines.
> >
> > Can you please explain why?
>
> I'm quite sure this was discussed in the context of commits
> 5fd29d6ccbc98884 ("printk: clean up handling of log-levels and
> newlines") and 4bcc595ccd80decb ("printk: reinstate KERN_CONT for
> printing continuation lines"), but I couldn't find a pointer to an
> official statement.
Not a printk expert, but in first commit, Linus removed need of "\n"
together with KERN_CONT, and in second commit he returned KERN_CONT,
but didn't return need of "\n".
>
> I did find[1], which states:
>
> The printk subsystem will, for every printk, check
> if the last printk has a newline termination and if
> it doesn't and the current printk does not start with
> KERN_CONT will insert a newline.
>
> The negative to this approach is the last printk,
> if it does not have a newline, is buffered and not
> emitted until another printk occurs.
I have no idea if it is continue to be true in 2022.
>
> There is also the (now small) possibility that
> multiple concurrent kernel threads or processes
> could interleave printks without a terminating
> newline and a different process could emit a
> printk that starts with KERN_CONT and the emitted
> message could be garbled.
>
> [1] https://lore.kernel.org/all/b867ee8a02043ec6b18c9330bfe3a091d66c816c.camel@perches.com
>
> Gr{oetje,eeting}s,
>
> Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
> -- Linus Torvalds
next prev parent reply other threads:[~2022-11-17 10:57 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-15 23:55 [PATCH] net: ethernet: renesas: rswitch: Fix MAC address info Yoshihiro Shimoda
2022-11-16 23:14 ` Saeed Mahameed
2022-11-16 23:35 ` Vladimir Oltean
2022-11-17 8:57 ` Yoshihiro Shimoda
2022-11-17 3:58 ` Dan Carpenter
2022-11-17 4:10 ` Dan Carpenter
2022-11-17 6:09 ` Leon Romanovsky
2022-11-17 8:58 ` Yoshihiro Shimoda
2022-11-17 8:59 ` Geert Uytterhoeven
2022-11-17 9:14 ` Leon Romanovsky
2022-11-17 9:38 ` Geert Uytterhoeven
2022-11-17 10:54 ` Leon Romanovsky [this message]
2022-11-18 0:16 ` Yoshihiro Shimoda
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=Y3YS3Q8WqtWalsAf@unreal \
--to=leon@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=error27@gmail.com \
--cc=geert+renesas@glider.be \
--cc=geert@linux-m68k.org \
--cc=kuba@kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=yoshihiro.shimoda.uh@renesas.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).