Re: [PATCH net-next v6 5/9] net: dsa: microchip: ksz9477: Add Wake on Magic Packet support

From: Vladimir Oltean
Date: Fri Oct 20 2023 - 04:19:00 EST


On Thu, Oct 19, 2023 at 07:17:32PM +0100, Russell King (Oracle) wrote:
> On Thu, Oct 19, 2023 at 08:29:53PM +0300, Vladimir Oltean wrote:
> > > - dev_dbg(dev->dev, "Wake event on port %d due to: %s %s\n", port,
> > > + dev_dbg(dev->dev, "Wake event on port %d due to: %s %s %s\n", port,
> > > + pme_status & PME_WOL_MAGICPKT ? "\"Magic Packet\"" : "",
> > > pme_status & PME_WOL_LINKUP ? "\"Link Up\"" : "",
> > > pme_status & PME_WOL_ENERGY ? "\"Enery detect\"" : "");
> >
> > Trivial: if you format the printf string as %s%s%s and the arguments as
> > "\"Magic Packet\" " : "", then the printed line won't have a trailing
> > space at the end.
>
> Sadly, it still will. The best solution is to prepend the space
> character to each entry in the "list" and remove the space characters
> after the : in the format string thusly:
>
> dev_dbg(dev->dev, "Wake event on port %d due to:%s%s%s\n", port,
> pme_status & PME_WOL_MAGICPKT ? " \"Magic Packet\"" : "",
> pme_status & PME_WOL_LINKUP ? " \"Link Up\"" : "",
> pme_status & PME_WOL_ENERGY ? " \"Enery detect\"" : "");

Thanks for correcting me.