[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <481224416317f5d690e7e28cd32b77bf06cdcec9.camel@perches.com>
Date: Thu, 30 Jul 2020 10:22:43 -0700
From: Joe Perches <joe@...ches.com>
To: Alexander Lobakin <alobakin@...me>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc: Ariel Elior <aelior@...vell.com>, GR-everest-linux-l2@...vell.com,
netdev@...r.kernel.org, "David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1] qede: Use %pM format specifier for MAC addresses
On Thu, 2020-07-30 at 16:29 +0000, Alexander Lobakin wrote:
> From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> Date: Thu, 30 Jul 2020 19:00:57 +0300
>
> > Convert to %pM instead of using custom code.
> >
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> > ---
> > drivers/net/ethernet/qlogic/qede/qede_main.c | 4 +---
> > 1 file changed, 1 insertion(+), 3 deletions(-)
>
> Thanks!
>
> Acked-by: Alexander Lobakin <alobakin@...me>
>
> > diff --git a/drivers/net/ethernet/qlogic/qede/qede_main.c b/drivers/net/ethernet/qlogic/qede/qede_main.c
> > index 1aaae3203f5a..4250c17940c0 100644
> > --- a/drivers/net/ethernet/qlogic/qede/qede_main.c
> > +++ b/drivers/net/ethernet/qlogic/qede/qede_main.c
> > @@ -144,9 +144,7 @@ static int qede_set_vf_mac(struct net_device *ndev, int vfidx, u8 *mac)
> > {
> > struct qede_dev *edev = netdev_priv(ndev);
> >
> > - DP_VERBOSE(edev, QED_MSG_IOV,
> > - "Setting MAC %02x:%02x:%02x:%02x:%02x:%02x to VF [%d]\n",
> > - mac[0], mac[1], mac[2], mac[3], mac[4], mac[5], vfidx);
> > + DP_VERBOSE(edev, QED_MSG_IOV, "Setting MAC %pM to VF [%d]\n", mac, vfidx);
> >
> > if (!is_valid_ether_addr(mac)) {
> > DP_VERBOSE(edev, QED_MSG_IOV, "MAC address isn't valid\n");
> > --
> > 2.27.0
I would have expected the debugging output to be in the
opposite order with the valid address test first.
Something like:
---
drivers/net/ethernet/qlogic/qede/qede_main.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/qlogic/qede/qede_main.c b/drivers/net/ethernet/qlogic/qede/qede_main.c
index 1aaae3203f5a..30bf9aebd5b8 100644
--- a/drivers/net/ethernet/qlogic/qede/qede_main.c
+++ b/drivers/net/ethernet/qlogic/qede/qede_main.c
@@ -144,15 +144,15 @@ static int qede_set_vf_mac(struct net_device *ndev, int vfidx, u8 *mac)
{
struct qede_dev *edev = netdev_priv(ndev);
- DP_VERBOSE(edev, QED_MSG_IOV,
- "Setting MAC %02x:%02x:%02x:%02x:%02x:%02x to VF [%d]\n",
- mac[0], mac[1], mac[2], mac[3], mac[4], mac[5], vfidx);
-
if (!is_valid_ether_addr(mac)) {
- DP_VERBOSE(edev, QED_MSG_IOV, "MAC address isn't valid\n");
+ DP_VERBOSE(edev, QED_MSG_IOV,
+ "Invalid MAC address %pM for VF [%d]\n", mac, vfidx);
return -EINVAL;
}
+ DP_VERBOSE(edev, QED_MSG_IOV, "Setting MAC %pM to VF [%d]\n",
+ mac, vfidx);
+
return edev->ops->iov->set_mac(edev->cdev, mac, vfidx);
}
Powered by blists - more mailing lists