Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1222285

Re: [PATCH v2 5/5] stmmac: replace if (netif_msg_type) by their netif_xxx counterpart

From Joe Perches <joe@perches.com>
Newsgroups linux.kernel
Subject Re: [PATCH v2 5/5] stmmac: replace if (netif_msg_type) by their netif_xxx counterpart
Date 2015-09-10 18:30 +0200
Message-ID <q7cTx-6MC-43@gated-at.bofh.it> (permalink)
References <q79iW-1uR-3@gated-at.bofh.it> <q79iX-1uR-33@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, 2015-09-10 at 14:37 +0200, LABBE Corentin wrote:
> replace all
> if (netif_msg_type(priv)) dev_xxx(priv->devices, ...)
> by the simplier macro netif_xxx(priv, hw, priv->dev, ...)

Thanks.  Trivia:

> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
[]
> @@ -733,10 +735,9 @@ static void stmmac_adjust_link(struct net_device *dev)
>  				stmmac_hw_fix_mac_speed(priv);
>  				break;
>  			default:
> -				if (netif_msg_link(priv))
> -					netdev_warn(priv->dev,
> -						    "%s: Speed (%d) not 10/100\n",
> -						    dev->name, phydev->speed);
> +				netif_warn(priv, link, priv->dev,
> +					   "%s: Speed (%d) not 10/100\n",
> +					   dev->name, phydev->speed);

Maybe add another patch removing dev->name where used
in logging as it's likely redundant.

> @@ -1038,18 +1039,15 @@ static int init_dma_desc_rings(struct net_device *dev, gfp_t flags)
>  
>  	priv->dma_buf_sz = bfsize;
>  
> -	if (netif_msg_probe(priv))
> -		netdev_dbg(priv->dev, "%s: txsize %d, rxsize %d, bfsize %d\n",
> -			   __func__, txsize, rxsize, bfsize);
> +	netif_dbg(priv, probe, priv->dev, "%s: txsize %d, rxsize %d, bfsize %d\n",
> +		  __func__, txsize, rxsize, bfsize);

And another removing __func__ from the _dbg uses as
it's relatively low value and dynamic debug can add it.


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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

stmmac: improve logging LABBE Corentin <clabbe.montjoie@gmail.com> - 2015-09-10 14:40 +0200
  [PATCH v2 5/5] stmmac: replace if (netif_msg_type) by their netif_xxx counterpart LABBE Corentin <clabbe.montjoie@gmail.com> - 2015-09-10 14:40 +0200
    Re: [PATCH v2 5/5] stmmac: replace if (netif_msg_type) by their  netif_xxx counterpart Joe Perches <joe@perches.com> - 2015-09-10 18:30 +0200
  [PATCH v2 2/5] stmmac: replace hardcoded function name by __func__ LABBE Corentin <clabbe.montjoie@gmail.com> - 2015-09-10 14:40 +0200
  Re: stmmac: improve logging David Miller <davem@davemloft.net> - 2015-09-15 22:40 +0200

csiph-web