diff mbox

sh_eth: fix garbled TX error message

Message ID 201401110241.49471.sergei.shtylyov@cogentembedded.com (mailing list archive)
State Superseded
Headers show

Commit Message

Sergei Shtylyov Jan. 10, 2014, 11:41 p.m. UTC
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.

While at it, insert an empty line after the nearby declaration.

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

---
Although being a fix, this patch is against the 'net-next.git' repo as it's does
not seem important enough at this time in the release cycle. Please consider it
for the stable kernel though...

 drivers/net/ethernet/renesas/sh_eth.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Simon Horman Jan. 13, 2014, 12:45 a.m. UTC | #1
On Sat, Jan 11, 2014 at 02:41:49AM +0300, Sergei Shtylyov 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.
> 
> While at it, insert an empty line after the nearby declaration.
> 
> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

Reviewed-by: Simon Horman <horms+renesas@verge.net.au>

> 
> ---
> Although being a fix, this patch is against the 'net-next.git' repo as it's does
> not seem important enough at this time in the release cycle. Please consider it
> for the stable kernel though...
> 
>  drivers/net/ethernet/renesas/sh_eth.c |    8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> Index: net-next/drivers/net/ethernet/renesas/sh_eth.c
> ===================================================================
> --- net-next.orig/drivers/net/ethernet/renesas/sh_eth.c
> +++ net-next/drivers/net/ethernet/renesas/sh_eth.c
> @@ -1513,11 +1513,11 @@ ignore_link:
>  	if (intr_status & mask) {
>  		/* Tx error */
>  		u32 edtrr = sh_eth_read(ndev, EDTRR);
> +
>  		/* dmesg */
> -		dev_err(&ndev->dev, "TX error. status=%8.8x cur_tx=%8.8x ",
> -			intr_status, mdp->cur_tx);
> -		dev_err(&ndev->dev, "dirty_tx=%8.8x state=%8.8x EDTRR=%8.8x.\n",
> -			mdp->dirty_tx, (u32) ndev->state, edtrr);
> +		dev_err(&ndev->dev, "TX error. status=%8.8x cur_tx=%8.8x dirty_tx=%8.8x state=%8.8x EDTRR=%8.8x.\n",
> +			intr_status, mdp->cur_tx, mdp->dirty_tx,
> +			(u32)ndev->state, edtrr);
>  		/* dirty buffer free */
>  		sh_eth_txfree(ndev);
>  
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sh" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller Jan. 14, 2014, 7:29 a.m. UTC | #2
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Date: Sat, 11 Jan 2014 02:41:49 +0300

> 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.
> 
> While at it, insert an empty line after the nearby declaration.
> 
> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

Applied, thanks.

I don't think this is really -stable material, sorry.
--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Sergei Shtylyov Jan. 14, 2014, 11:49 a.m. UTC | #3
Hello.

On 14-01-2014 11:29, David Miller 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.

>> While at it, insert an empty line after the nearby declaration.

>> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

> Applied, thanks.

> I don't think this is really -stable material, sorry.

    Right, this is not even a fix anymore, at least not from 2.6.31 times (if 
Joe's estimate was correct), and I was going to resubmit it as a cleanup. 
Should have warned you not to apply yet but didn't, sorry.

WBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

Index: net-next/drivers/net/ethernet/renesas/sh_eth.c
===================================================================
--- net-next.orig/drivers/net/ethernet/renesas/sh_eth.c
+++ net-next/drivers/net/ethernet/renesas/sh_eth.c
@@ -1513,11 +1513,11 @@  ignore_link:
 	if (intr_status & mask) {
 		/* Tx error */
 		u32 edtrr = sh_eth_read(ndev, EDTRR);
+
 		/* dmesg */
-		dev_err(&ndev->dev, "TX error. status=%8.8x cur_tx=%8.8x ",
-			intr_status, mdp->cur_tx);
-		dev_err(&ndev->dev, "dirty_tx=%8.8x state=%8.8x EDTRR=%8.8x.\n",
-			mdp->dirty_tx, (u32) ndev->state, edtrr);
+		dev_err(&ndev->dev, "TX error. status=%8.8x cur_tx=%8.8x dirty_tx=%8.8x state=%8.8x EDTRR=%8.8x.\n",
+			intr_status, mdp->cur_tx, mdp->dirty_tx,
+			(u32)ndev->state, edtrr);
 		/* dirty buffer free */
 		sh_eth_txfree(ndev);