Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp423747imm; Thu, 26 Jul 2018 22:48:51 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfCdi0sKLJw8DFMCIy5jFDXaY/uD3ckeiBy4QS5Wmht82YReX5gGtXImunMsLwIIyiOvOO5 X-Received: by 2002:a62:3d86:: with SMTP id x6-v6mr5183563pfj.192.1532670531203; Thu, 26 Jul 2018 22:48:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532670531; cv=none; d=google.com; s=arc-20160816; b=rWsDH6FV/IZVxVCU4yIb26ADAQ+R+O8u4PK+jaPwurHey5fF7LLYciiMVqgEFRuefl H9toVV4lUOw4z3DDqwX8HyKgbtMdBYNt3h1jnVkpC2LM9WRS0UBEHbl2u6trleBpqjuY Bl7xNfKDFmrcfNUaQGDU61FT6XZ5/0C46DW0qcv770Y0DLsIuriTRW6cyAK8NMGHXdLu U0DVsnKG4IeHYmN6I1AmZNrBujBk5tF/uZU4nLF+9HqzEe34RGiPkRDajAD+HJN5tZl+ bJKnWJE1pYvvvnAXFw6UrBTcyvnjP2pkLGy3VyhBiFvvzWvbKWIm0ESs1GEGcrMLYfz3 CZEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=AyOWqV7Wx96+aKn00y1iY+aCN4pwnNfEecIu3hcFAnY=; b=CbK00hGPEU3PuVPhhU/cCB2bB+WtZk4NDi8gqUt/ezSeQ6NS0UuA5i6VkGsFSe7RLg Jz59aq8mA/PhGXlHOKFbcdSXa2r4przQ9WjONyZGeI4Z2+TTkkZEhTgH/bBN34AwJmVU JQdWFsacbswEyKgLPLtgyvAd00piBe984Ih700m9uzeijuPHkw+4x54cKrOU1F7Nm19g r0KvxxXMsOq6/HNWs+V+JJ+B0v03dG34EuMmT3QgYtWDd3h2DYhPVF/KFe6QCQnZdbQ0 tpU2pzs65KFLk0dfrO6Ar7YWuSR5ALFQFj7JWzPqOXnW0v6bcMJ1dSvkHvN1yRYngQNC HR7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=XOKUsqrd; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o18-v6si3067533pgg.250.2018.07.26.22.48.08; Thu, 26 Jul 2018 22:48:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=XOKUsqrd; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729432AbeG0HGL (ORCPT + 99 others); Fri, 27 Jul 2018 03:06:11 -0400 Received: from mail-qt0-f196.google.com ([209.85.216.196]:36760 "EHLO mail-qt0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726044AbeG0HGL (ORCPT ); Fri, 27 Jul 2018 03:06:11 -0400 Received: by mail-qt0-f196.google.com with SMTP id t5-v6so3987296qtn.3 for ; Thu, 26 Jul 2018 22:45:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=AyOWqV7Wx96+aKn00y1iY+aCN4pwnNfEecIu3hcFAnY=; b=XOKUsqrdEzpXI1h3mGOE5wHwHyLLEI8lJPvVMHqsGT/qnHYMAhWUhkqjnB/fqe8sT5 QsDShu+a3d5/CMW0jnxkBjT1QNEIxVTkHnRKcySDyKIFSZiyEmOZDZDaWp/XVDPJkz3P peSJnUzBGTxHRoF27IGwGEBHDzuW0KP8bldig= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=AyOWqV7Wx96+aKn00y1iY+aCN4pwnNfEecIu3hcFAnY=; b=qq3MCU9ZGvffL4ndMujawrB0v7a8qFoOa2IBHsjfdc++8fOV3L2407Ii+Lw4r9+uwd BcNlZwJC4ioW2QZKYMSRUbwXE/0PdDAG+wROQIgvCrzQFPcLrGKfkznV+dc1sTuRy2gO vKqAYKxO4oxjIcsYGpiRERgq6ytppvkFnrNqbX+NrBnBXSVx02DgTCAwXsrzwnhp1XAu de9Nrs0NDRmi4I53cHKDYQntIulZM+c+5/3ONDYEJKiNZCNyLqwG/EFm6GcAVvHPkVoa nDRZ1S4CnMUpSxLXzK5IZNLcyUpBeNf476A2ov8pnovKuxdoF5PQGLU/VFT5PtOmCP00 4l6g== X-Gm-Message-State: AOUpUlGoAQbhtpHaKGhUCT70x3BfiWgMWgcRfPj0ab/CCPe9QXAKAXAS 7zyqXOf3tF7w8Zc9uVWNt31CRqTdFo3rakP925qsEA== X-Received: by 2002:ac8:3647:: with SMTP id n7-v6mr4739936qtb.65.1532670357931; Thu, 26 Jul 2018 22:45:57 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a0c:9206:0:0:0:0:0 with HTTP; Thu, 26 Jul 2018 22:45:57 -0700 (PDT) In-Reply-To: References: <20180725111459.10800-1-yuehaibing@huawei.com> From: Vasundhara Volam Date: Fri, 27 Jul 2018 11:15:57 +0530 Message-ID: Subject: Re: [PATCH net-next] bnxt_en: combine 'else if' and 'else' into single branche To: YueHaibing Cc: David Miller , "michael.chan@broadcom.com" , open list , Netdev Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 26, 2018 at 8:24 PM, Vasundhara Volam wrote: > On Wed, Jul 25, 2018 at 4:44 PM, YueHaibing wrote: >> >> The else-if branch and else branch set mac_ok to true similarly, >> so combine the two into single else branch. >> >> Aslo add comments to explain the two conditions, which >> from Michael Chan and Vasundhara Volam. >> >> Signed-off-by: YueHaibing >> --- >> drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c | 8 ++++++-- >> 1 file changed, 6 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c >> index a649108..f560845 100644 >> --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c >> +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c >> @@ -956,9 +956,13 @@ static int bnxt_vf_validate_set_mac(struct bnxt *bp, struct bnxt_vf_info *vf) >> } else if (is_valid_ether_addr(vf->vf_mac_addr)) { >> if (ether_addr_equal((const u8 *)req->l2_addr, vf->vf_mac_addr)) >> mac_ok = true; >> - } else if (bp->hwrm_spec_code < 0x10202) { >> - mac_ok = true; >> } else { >> + /* There are two cases: >> + * 1.If firmware spec < 0x10202,VF MAC address is not forwarded >> + * to the PF and so it doesn't have to match >> + * 2.Allow VF to modify it's own MAC when PF has not assigned a >> + * valid MAC address and firmware spec >= 0x10202 >> + */ > No, this is not correct either. You are not covering both conditions. > else part with cover if (!is_valid_ether_addr(vf->vf_mac_addr)) > before. My apologies, I was thinking one more condition was required. Patch seems fine. >> mac_ok = true; >> } >> if (mac_ok) >> -- >> 2.7.0 >> >>