[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <VI1PR0402MB36004F96D79358F7EFFE0EB6FF150@VI1PR0402MB3600.eurprd04.prod.outlook.com>
Date: Tue, 4 Jun 2019 03:55:07 +0000
From: Andy Duan <fugang.duan@....com>
To: Fabio Estevam <festevam@...il.com>,
"davem@...emloft.net" <davem@...emloft.net>
CC: "netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: RE: [EXT] [PATCH net-next v2 1/2] net: fec_main: Use netdev_err()
instead of pr_err()
From: Fabio Estevam <festevam@...il.com> Sent: Tuesday, June 4, 2019 11:05 AM
> netdev_err() is more appropriate for printing error messages inside network
> drivers, so switch to netdev_err().
>
> Signed-off-by: Fabio Estevam <festevam@...il.com>
> ---
> Changes since v1:
> - Split the changes from fec_main and fec_ptp in two different patches
>
> drivers/net/ethernet/freescale/fec_main.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/ethernet/freescale/fec_main.c
> b/drivers/net/ethernet/freescale/fec_main.c
> index 848defa33d3a..4ec9733a88d5 100644
> --- a/drivers/net/ethernet/freescale/fec_main.c
> +++ b/drivers/net/ethernet/freescale/fec_main.c
> @@ -2452,24 +2452,24 @@ fec_enet_set_coalesce(struct net_device *ndev,
> struct ethtool_coalesce *ec)
> return -EOPNOTSUPP;
>
> if (ec->rx_max_coalesced_frames > 255) {
> - pr_err("Rx coalesced frames exceed hardware
> limitation\n");
> + netdev_err(ndev, "Rx coalesced frames exceed hardware
> + limitation\n");
The API still can be called before .register_netdev(), which means ndev is uninitialized.
> return -EINVAL;
> }
>
> if (ec->tx_max_coalesced_frames > 255) {
> - pr_err("Tx coalesced frame exceed hardware
> limitation\n");
> + netdev_err(ndev, "Tx coalesced frame exceed hardware
> + limitation\n");
> return -EINVAL;
> }
>
> cycle = fec_enet_us_to_itr_clock(ndev, fep->rx_time_itr);
> if (cycle > 0xFFFF) {
> - pr_err("Rx coalesced usec exceed hardware
> limitation\n");
> + netdev_err(ndev, "Rx coalesced usec exceed hardware
> + limitation\n");
> return -EINVAL;
> }
>
> cycle = fec_enet_us_to_itr_clock(ndev, fep->tx_time_itr);
> if (cycle > 0xFFFF) {
> - pr_err("Rx coalesced usec exceed hardware
> limitation\n");
> + netdev_err(ndev, "Rx coalesced usec exceed hardware
> + limitation\n");
> return -EINVAL;
> }
>
> --
> 2.17.1
Powered by blists - more mailing lists