From: Andy Shevchenko <[email protected]>
Date: Thu, 30 Jul 2020 19:00:57 +0300
> Convert to %pM instead of using custom code.
>
> Signed-off-by: Andy Shevchenko <[email protected]>
> ---
> drivers/net/ethernet/qlogic/qede/qede_main.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
Thanks!
Acked-by: Alexander Lobakin <[email protected]>
> 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
Al
On Thu, 2020-07-30 at 16:29 +0000, Alexander Lobakin wrote:
> From: Andy Shevchenko <[email protected]>
> Date: Thu, 30 Jul 2020 19:00:57 +0300
>
> > Convert to %pM instead of using custom code.
> >
> > Signed-off-by: Andy Shevchenko <[email protected]>
> > ---
> > drivers/net/ethernet/qlogic/qede/qede_main.c | 4 +---
> > 1 file changed, 1 insertion(+), 3 deletions(-)
>
> Thanks!
>
> Acked-by: Alexander Lobakin <[email protected]>
>
> > 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);
}