Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp2104774ybg; Thu, 30 Jul 2020 10:23:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwEdfGdFpFXBPM813diCP1hM2O0rK3zn5+suKAp4UA3drSjCtAF75LulRCu4qvW5LU9TZ/p X-Received: by 2002:aa7:de15:: with SMTP id h21mr18662edv.23.1596129817691; Thu, 30 Jul 2020 10:23:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596129817; cv=none; d=google.com; s=arc-20160816; b=CqHgcFUQgiYi7tnjRN63mwdV/z4c7eZ+AVxODWi2z61gDzTVQjhBcdpTtByeEzIO2x UCQ6vDpngearCcu9MYKJfNzhF3th/XF3KuEDg7p2+SSyEYriY2a+CfpJRvxLk+qdJ1q6 qViwnJfToD5e4qPMO+Esw+hsL9Gb0dyiA2Sv3eZfpMvxfHX9sLvE0m+RHRsAl1v6TBbB 0Opd2osciqJ7Om6Zy6p7FFiU8wwPm+5Q9P5B9GArnUW9M07fJRmUf7bRKr6rZHNiDcDZ Hm5rBFD1Bk/yHpbg8Hg2UTcVu9Bt17vcu/pDF+HAI6m8YsAn9+DKzCQBbNhkdWu5cvJI Ry4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=1x9FCAzQKzyPjW+QiAwIfdjOU543DLZWGxgZvXmi0bE=; b=Xc46X3u6R12TeW/qZN4lE8voU0GY1Uyqn7tw0iP9QD4Rl9ujj3IDLgLFHlXiW+afgW tx9vqRee12zH2A7+V76BLxm73epBjT7Eve5GvUoTgLj7bOrp9h7FEyS6epyK0LB1GtiE qDqAMGiVzgBIVL7kgflBtXX68Z5ShO1jRhbIc4rD6w6+3wtODC8ZJUwO7KB/laPDoPTg oRzV84h0ACEH6BG4V8UgWTj0rUz+ssiqivQnCuBUHgpVVVzdqDVz8b7KfqjnynP14eLa y+S8IVVT05i3gYYbbZzfpFuzKBy5ZzqF05WG+iV81yWCbwJlLFME2yUIO2UVZNfBnSlG LQGQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t19si3404035ejd.62.2020.07.30.10.23.14; Thu, 30 Jul 2020 10:23:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728543AbgG3RWs (ORCPT + 99 others); Thu, 30 Jul 2020 13:22:48 -0400 Received: from smtprelay0185.hostedemail.com ([216.40.44.185]:33894 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726353AbgG3RWs (ORCPT ); Thu, 30 Jul 2020 13:22:48 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay07.hostedemail.com (Postfix) with ESMTP id B23D8181D3028; Thu, 30 Jul 2020 17:22:46 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,,RULES_HIT:41:355:379:599:800:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1431:1437:1515:1516:1518:1534:1542:1593:1594:1711:1730:1747:1777:1792:2198:2199:2393:2553:2559:2562:2731:2828:3138:3139:3140:3141:3142:3353:3622:3865:3866:3867:3870:4250:4321:5007:7576:9040:9592:10004:10400:10848:10967:11026:11232:11473:11657:11658:11914:12043:12296:12297:12555:12740:12760:12895:13439:14181:14659:14721:21080:21433:21451:21627:21990:30003:30012:30054:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:1,LUA_SUMMARY:none X-HE-Tag: stick28_060683326f7c X-Filterd-Recvd-Size: 3622 Received: from XPS-9350.home (unknown [47.151.133.149]) (Authenticated sender: joe@perches.com) by omf02.hostedemail.com (Postfix) with ESMTPA; Thu, 30 Jul 2020 17:22:45 +0000 (UTC) Message-ID: <481224416317f5d690e7e28cd32b77bf06cdcec9.camel@perches.com> Subject: Re: [PATCH v1] qede: Use %pM format specifier for MAC addresses From: Joe Perches To: Alexander Lobakin , Andy Shevchenko Cc: Ariel Elior , GR-everest-linux-l2@marvell.com, netdev@vger.kernel.org, "David S. Miller" , Jakub Kicinski , linux-kernel@vger.kernel.org Date: Thu, 30 Jul 2020 10:22:43 -0700 In-Reply-To: References: Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.36.3-0ubuntu1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2020-07-30 at 16:29 +0000, Alexander Lobakin wrote: > From: Andy Shevchenko > Date: Thu, 30 Jul 2020 19:00:57 +0300 > > > Convert to %pM instead of using custom code. > > > > Signed-off-by: Andy Shevchenko > > --- > > drivers/net/ethernet/qlogic/qede/qede_main.c | 4 +--- > > 1 file changed, 1 insertion(+), 3 deletions(-) > > Thanks! > > Acked-by: Alexander Lobakin > > > 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); }