From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Joe Perches <joe@perches.com>, Simon Horman <horms@verge.net.au>
Cc: netdev@vger.kernel.org, linux-sh@vger.kernel.org
Subject: Re: [PATCH] sh_eth: fix garbled TX error message
Date: Mon, 13 Jan 2014 16:15:19 +0000 [thread overview]
Message-ID: <52D41117.3040809@cogentembedded.com> (raw)
In-Reply-To: <1389576241.24849.10.camel@joe-AO722>
Hello.
On 13-012014 5:24, Joe Perches wrote:
>>> sh_eth_error() in case of a TX error tries to print a message using 2 dev_err()
>>> calls with the first string not finished by '\n', so that the resulting message
>>> would inevitably come out garbled, with something like "3net eth0: " inserted
>>> in the middle. Avoid that by merging 2 calls into one.
> I believe this interleaving should not happen since
> commit e28d713704117bca0820c732210df6075b09f13b
> (2.6.31 days)
I believe you have given me the wrong commit, which has nothing to do the
the newline problem per se. It just adds KERN_DEFAULT. I was able to find the
correct commit though: it's the parent of the commit you cited,
5fd29d6ccbc98884569d6f3105aeca70858b3e0f -- so you're probably right, and I
should have tested my assumption beforehand... (I'd like to merge these
dev_err() calls still though).
> Perhaps it'd be better to use netdev_<level> and
> netif_<level> instead of dev_<level> and pr_<level>.
Thank you, I got it the first time you suggested it, I just haven't had
time to implement it yet.
> uncompiled/untested...
Thanks for the patch. I don't agree with all of it though...
> ---
>
> drivers/net/ethernet/renesas/sh_eth.c | 63 ++++++++++++++++-------------------
> 1 file changed, 28 insertions(+), 35 deletions(-)
> diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
> index 8884107..6baad48 100644
> --- a/drivers/net/ethernet/renesas/sh_eth.c
> +++ b/drivers/net/ethernet/renesas/sh_eth.c
[...]
> @@ -2691,9 +2683,10 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
> /* read and set MAC address */
> read_mac_address(ndev, pd->mac_addr);
> if (!is_valid_ether_addr(ndev->dev_addr)) {
> - dev_warn(&pdev->dev,
> - "no valid MAC address supplied, using a random one.\n");
> eth_hw_addr_random(ndev);
> + dev_warn(&pdev->dev,
> + "no valid MAC address supplied, using random %pM\n",
> + ndev->dev_addr);
There's no need to print random MAC address twice. It's already printed
right below.
WBR, Sergei
WARNING: multiple messages have this Message-ID (diff)
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Joe Perches <joe@perches.com>, Simon Horman <horms@verge.net.au>
Cc: netdev@vger.kernel.org, linux-sh@vger.kernel.org
Subject: Re: [PATCH] sh_eth: fix garbled TX error message
Date: Mon, 13 Jan 2014 20:15:19 +0400 [thread overview]
Message-ID: <52D41117.3040809@cogentembedded.com> (raw)
In-Reply-To: <1389576241.24849.10.camel@joe-AO722>
Hello.
On 13-012014 5:24, Joe Perches wrote:
>>> sh_eth_error() in case of a TX error tries to print a message using 2 dev_err()
>>> calls with the first string not finished by '\n', so that the resulting message
>>> would inevitably come out garbled, with something like "3net eth0: " inserted
>>> in the middle. Avoid that by merging 2 calls into one.
> I believe this interleaving should not happen since
> commit e28d713704117bca0820c732210df6075b09f13b
> (2.6.31 days)
I believe you have given me the wrong commit, which has nothing to do the
the newline problem per se. It just adds KERN_DEFAULT. I was able to find the
correct commit though: it's the parent of the commit you cited,
5fd29d6ccbc98884569d6f3105aeca70858b3e0f -- so you're probably right, and I
should have tested my assumption beforehand... (I'd like to merge these
dev_err() calls still though).
> Perhaps it'd be better to use netdev_<level> and
> netif_<level> instead of dev_<level> and pr_<level>.
Thank you, I got it the first time you suggested it, I just haven't had
time to implement it yet.
> uncompiled/untested...
Thanks for the patch. I don't agree with all of it though...
> ---
>
> drivers/net/ethernet/renesas/sh_eth.c | 63 ++++++++++++++++-------------------
> 1 file changed, 28 insertions(+), 35 deletions(-)
> diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
> index 8884107..6baad48 100644
> --- a/drivers/net/ethernet/renesas/sh_eth.c
> +++ b/drivers/net/ethernet/renesas/sh_eth.c
[...]
> @@ -2691,9 +2683,10 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
> /* read and set MAC address */
> read_mac_address(ndev, pd->mac_addr);
> if (!is_valid_ether_addr(ndev->dev_addr)) {
> - dev_warn(&pdev->dev,
> - "no valid MAC address supplied, using a random one.\n");
> eth_hw_addr_random(ndev);
> + dev_warn(&pdev->dev,
> + "no valid MAC address supplied, using random %pM\n",
> + ndev->dev_addr);
There's no need to print random MAC address twice. It's already printed
right below.
WBR, Sergei
next prev parent reply other threads:[~2014-01-13 16:15 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-10 22:41 [PATCH] sh_eth: fix garbled TX error message Sergei Shtylyov
2014-01-10 23:41 ` Sergei Shtylyov
2014-01-13 0:45 ` Simon Horman
2014-01-13 0:45 ` Simon Horman
2014-01-13 1:24 ` Joe Perches
2014-01-13 1:24 ` Joe Perches
2014-01-13 16:15 ` Sergei Shtylyov [this message]
2014-01-13 16:15 ` Sergei Shtylyov
2014-01-13 16:51 ` Joe Perches
2014-01-13 16:51 ` Joe Perches
2014-01-14 7:29 ` David Miller
2014-01-14 7:29 ` David Miller
2014-01-14 11:49 ` Sergei Shtylyov
2014-01-14 11:49 ` Sergei Shtylyov
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=52D41117.3040809@cogentembedded.com \
--to=sergei.shtylyov@cogentembedded.com \
--cc=horms@verge.net.au \
--cc=joe@perches.com \
--cc=linux-sh@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/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.