Netdev Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH v1] qede: Use %pM format specifier for MAC addresses
@ 2020-07-30 16:00 Andy Shevchenko
  2020-07-31 23:48 ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Andy Shevchenko @ 2020-07-30 16:00 UTC (permalink / raw)
  To: Ariel Elior, GR-everest-linux-l2, Alexander Lobakin, netdev,
	David S. Miller, Jakub Kicinski
  Cc: Andy Shevchenko

Convert to %pM instead of using custom code.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/net/ethernet/qlogic/qede/qede_main.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v1] qede: Use %pM format specifier for MAC addresses
  2020-07-30 16:00 [PATCH v1] qede: Use %pM format specifier for MAC addresses Andy Shevchenko
@ 2020-07-31 23:48 ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2020-07-31 23:48 UTC (permalink / raw)
  To: andriy.shevchenko; +Cc: aelior, GR-everest-linux-l2, alobakin, netdev, kuba

From: Andy Shevchenko <andriy.shevchenko@linux.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@linux.intel.com>

Applied to net-next

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v1] qede: Use %pM format specifier for MAC addresses
  2020-07-30 16:29 Alexander Lobakin
@ 2020-07-30 17:22 ` Joe Perches
  0 siblings, 0 replies; 4+ messages in thread
From: Joe Perches @ 2020-07-30 17:22 UTC (permalink / raw)
  To: Alexander Lobakin, Andy Shevchenko
  Cc: Ariel Elior, GR-everest-linux-l2, netdev, David S. Miller,
	Jakub Kicinski, linux-kernel

On Thu, 2020-07-30 at 16:29 +0000, Alexander Lobakin wrote:
> From: Andy Shevchenko <andriy.shevchenko@linux.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@linux.intel.com>
> > ---
> >  drivers/net/ethernet/qlogic/qede/qede_main.c | 4 +---
> >  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> Thanks!
> 
> Acked-by: Alexander Lobakin <alobakin@pm.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);
 }
 



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v1] qede: Use %pM format specifier for MAC addresses
@ 2020-07-30 16:29 Alexander Lobakin
  2020-07-30 17:22 ` Joe Perches
  0 siblings, 1 reply; 4+ messages in thread
From: Alexander Lobakin @ 2020-07-30 16:29 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Alexander Lobakin, Ariel Elior, GR-everest-linux-l2, netdev,
	David S. Miller, Jakub Kicinski, linux-kernel

From: Andy Shevchenko <andriy.shevchenko@linux.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@linux.intel.com>
> ---
>  drivers/net/ethernet/qlogic/qede/qede_main.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)

Thanks!

Acked-by: Alexander Lobakin <alobakin@pm.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

Al


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-30 16:00 [PATCH v1] qede: Use %pM format specifier for MAC addresses Andy Shevchenko
2020-07-31 23:48 ` David Miller
2020-07-30 16:29 Alexander Lobakin
2020-07-30 17:22 ` Joe Perches

Netdev Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/netdev/0 netdev/git/0.git
	git clone --mirror https://lore.kernel.org/netdev/1 netdev/git/1.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 netdev netdev/ https://lore.kernel.org/netdev \
		netdev@vger.kernel.org
	public-inbox-index netdev

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.netdev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git