Re: [PATCH] sunhme: convert printk to pr_cont

2018-08-17 Thread David Miller
From: Mikulas Patocka 
Date: Fri, 17 Aug 2018 16:08:49 -0400 (EDT)

> I'm not an expert on networking code - you can change it if it is more 
> appropriate this way.

What Stephen is asking of you doesn't require networking expertiece
and he even gave you an example of how to do it.  All you would need
to do is test is suggestion and make sure it works properly.


Re: [PATCH] sunhme: convert printk to pr_cont

2018-08-17 Thread Mikulas Patocka



On Fri, 17 Aug 2018, Stephen Hemminger wrote:

> On Fri, 17 Aug 2018 15:12:22 -0400 (EDT)
> Mikulas Patocka  wrote:
> 
> > ===
> > --- linux-stable.orig/drivers/net/ethernet/sun/sunhme.c 2018-04-20 
> > 18:11:00.0 +0200
> > +++ linux-stable/drivers/net/ethernet/sun/sunhme.c  2018-08-13 
> > 22:01:08.0 +0200
> > @@ -572,21 +572,21 @@ static void display_link_mode(struct hap
> >  {
> > printk(KERN_INFO "%s: Link is up using ", hp->dev->name);
> > if (hp->tcvr_type == external)
> > -   printk("external ");
> > +   pr_cont("external ");
> > else
> > -   printk("internal ");
> > -   printk("transceiver at ");
> > +   pr_cont("internal ");
> > +   pr_cont("transceiver at ");
> > hp->sw_lpa = happy_meal_tcvr_read(hp, tregs, MII_LPA);
> > if (hp->sw_lpa & (LPA_100HALF | LPA_100FULL)) {
> > if (hp->sw_lpa & LPA_100FULL)
> > -   printk("100Mb/s, Full Duplex.\n");
> > +   pr_cont("100Mb/s, Full Duplex.\n");
> > else
> > -   printk("100Mb/s, Half Duplex.\n");
> > +   pr_cont("100Mb/s, Half Duplex.\n");
> > } else {
> > if (hp->sw_lpa & LPA_10FULL)
> > -   printk("10Mb/s, Full Duplex.\n");
> > +   pr_cont("10Mb/s, Full Duplex.\n");
> > else
> > -   printk("10Mb/s, Half Duplex.\n");
> > +   pr_cont("10Mb/s, Half Duplex.\n");
> > }
> >  }
> 
> Why not just  use a single netdev_info (or drop the useless message 
> altogether).
> 
> I.e
>   netdev_info(hp->dev, "Link is up using %s transceiver at %dMb/s %s 
> Duplex\n",
>   (hp->tcvr->type == external) ? "external" : "internal",
>   (hp->sw_lpa & (LPA_100HALF | LPA_100FULL)) ? 100 : 10,
>   (hw->sw_lpa & (LPA_100FULL | LPA_10FULL)) ? "Full" : "Half"));

I'm not an expert on networking code - you can change it if it is more 
appropriate this way.

Mikulas


Re: [PATCH] sunhme: convert printk to pr_cont

2018-08-17 Thread Stephen Hemminger
On Fri, 17 Aug 2018 15:12:22 -0400 (EDT)
Mikulas Patocka  wrote:

> ===
> --- linux-stable.orig/drivers/net/ethernet/sun/sunhme.c   2018-04-20 
> 18:11:00.0 +0200
> +++ linux-stable/drivers/net/ethernet/sun/sunhme.c2018-08-13 
> 22:01:08.0 +0200
> @@ -572,21 +572,21 @@ static void display_link_mode(struct hap
>  {
>   printk(KERN_INFO "%s: Link is up using ", hp->dev->name);
>   if (hp->tcvr_type == external)
> - printk("external ");
> + pr_cont("external ");
>   else
> - printk("internal ");
> - printk("transceiver at ");
> + pr_cont("internal ");
> + pr_cont("transceiver at ");
>   hp->sw_lpa = happy_meal_tcvr_read(hp, tregs, MII_LPA);
>   if (hp->sw_lpa & (LPA_100HALF | LPA_100FULL)) {
>   if (hp->sw_lpa & LPA_100FULL)
> - printk("100Mb/s, Full Duplex.\n");
> + pr_cont("100Mb/s, Full Duplex.\n");
>   else
> - printk("100Mb/s, Half Duplex.\n");
> + pr_cont("100Mb/s, Half Duplex.\n");
>   } else {
>   if (hp->sw_lpa & LPA_10FULL)
> - printk("10Mb/s, Full Duplex.\n");
> + pr_cont("10Mb/s, Full Duplex.\n");
>   else
> - printk("10Mb/s, Half Duplex.\n");
> + pr_cont("10Mb/s, Half Duplex.\n");
>   }
>  }

Why not just  use a single netdev_info (or drop the useless message altogether).

I.e
netdev_info(hp->dev, "Link is up using %s transceiver at %dMb/s %s 
Duplex\n",
(hp->tcvr->type == external) ? "external" : "internal",
(hp->sw_lpa & (LPA_100HALF | LPA_100FULL)) ? 100 : 10,
(hw->sw_lpa & (LPA_100FULL | LPA_10FULL)) ? "Full" : "Half"));


Re: [PATCH] sunhme: convert printk to pr_cont

2018-08-17 Thread David Miller
From: Mikulas Patocka 
Date: Fri, 17 Aug 2018 15:12:22 -0400 (EDT)

> The kernel adds newlines automatically unless pr_cont is used. This patch
> converts sunhme to use pr_cont, so that the messages are not broken to
> multiple lines.
> 
> The patch also adds "\n" to a few strings that were missing it.
> 
> Signed-off-by: Mikulas Patocka 
> Cc: sta...@vger.kernel.org

"stable", are you sure?  What crash or memory corruption does these
added newlines in the kernel log cuase?

I don't think this is appropriate for -stable, sorry.

At best this is net-next material, and that tree is closed right now.

Please resubmit this when the net-next tree opens back up again,
thanks.