From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 15BD8A034F; Tue, 11 Jan 2022 15:47:07 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7544242728; Tue, 11 Jan 2022 15:47:06 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id B836341143 for ; Tue, 11 Jan 2022 15:47:04 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1641912424; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=E/DEuK1vB9az4/jfz4o+UpKtPZeh91CbvKR9QxB3BY0=; b=RnGUBEEMNNrkp5JX++HVnyH9fAAoVEtVU8S6rmhluaDASxml0OWI4n7GO/E0xT9psKW0qe TU9IhWH7o67VvRpDXx0QE/1jHRRd0c6pd9AO2pR+bll/Jui6evYLZ6+XTZxFXEEt5tbKUj 4NAOGEqEgcrRFFiIfNP9X1GLKmpzD8M= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-120-YO6_w_m6NpSusTc6EmPWSw-1; Tue, 11 Jan 2022 09:47:01 -0500 X-MC-Unique: YO6_w_m6NpSusTc6EmPWSw-1 Received: by mail-wm1-f70.google.com with SMTP id v185-20020a1cacc2000000b0034906580813so1671013wme.1 for ; Tue, 11 Jan 2022 06:47:00 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent :content-language:to:cc:references:from:subject:in-reply-to :content-transfer-encoding; bh=E/DEuK1vB9az4/jfz4o+UpKtPZeh91CbvKR9QxB3BY0=; b=6QpdgkqvxsqFBSh9a3daO7NftkqzrEiLxG65lb2Oqi6gtXW43R2o4q39XJZF/De4k/ eaMIdM2ogG6FllTfMs5UDKvDeOYiBD7zXr8EhjPCsMimVx0JuhHFgJb/U9CAP7WN2PvO 7djOJOKPp8La877eCB2T5Fzs0+ciWbDmiBniaUE5DEEJaYWPMd5LxuFV54UMhZwMO+vI /VD2LkI12ZCIBwIMfr61PgXDUKRvUhvj+xUPGOpUh15cD8brlUdOlu50d8xj17uibGd/ vbnA1Wezt4ltpSpUXQ1ZOWV75yUUs0fgznRu/eEqNNE/XvsadQSYO1TMn9xD7Y5VnmSY Aepg== X-Gm-Message-State: AOAM531XscxNGTBU3Z8wc2eioq2erH982t8rsTbXmWnNh3kAQTrsHLyJ 7dELQaI2d4i53MnkVWTKl11gdCVDAbyGu+wiwfZ9N8g/3oczkvvYuRQnY/aEeONx8PveWg5dyGT kw2w= X-Received: by 2002:a5d:6da9:: with SMTP id u9mr4173354wrs.425.1641912419843; Tue, 11 Jan 2022 06:46:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJyI+YivRyTTIN0usor9isvozmOcrQ21JmfQ/qcNKBnz9nta2ro0qm631n3GF012ONhkPUs02w== X-Received: by 2002:a5d:6da9:: with SMTP id u9mr4173338wrs.425.1641912419618; Tue, 11 Jan 2022 06:46:59 -0800 (PST) Received: from [192.168.0.36] ([78.19.108.41]) by smtp.gmail.com with ESMTPSA id y14sm1173276wma.19.2022.01.11.06.46.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 11 Jan 2022 06:46:59 -0800 (PST) Message-ID: <585db764-26a3-6297-98b8-08301301fcf9@redhat.com> Date: Tue, 11 Jan 2022 14:46:57 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.0 To: Maxime Gouin , dev@dpdk.org Cc: Heinrich Kuhn , Alejandro Lucero , Olivier Matz References: <20220105103203.7166-1-maxime.gouin@6wind.com> From: Kevin Traynor Subject: Re: [PATCH 1/2] net/nfp: remove duplicated check when setting MAC address In-Reply-To: <20220105103203.7166-1-maxime.gouin@6wind.com> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ktraynor@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On 05/01/2022 10:32, Maxime Gouin wrote: > reported by code analysis tool C++test (version 10.4): > >> /build/dpdk-20.11/drivers/net/nfp/nfp_net.c >> 546 Conditions "(hw->ctrl &NFP_NET_CFG_CTRL_ENABLE) && > !! (hw->cap &NFP_NET_CFG_C" is always evaluated to false >> 547 Condition "! (hw->cap &NFP_NET_CFG_C" is always evaluated to false > > The previous "if" checks exactly the same condition. Removal of duplicate > code. > > Fixes: 2fe669f4bcd2 ("net/nfp: support MAC address change") > Cc: stable@dpdk.org > Signed-off-by: Maxime Gouin > Reviewed-by: Olivier Matz Acked-by: Kevin Traynor > --- > drivers/net/nfp/nfp_common.c | 4 ---- > 1 file changed, 4 deletions(-) > > diff --git a/drivers/net/nfp/nfp_common.c b/drivers/net/nfp/nfp_common.c > index f8978e803a0f..b26770dbfbe4 100644 > --- a/drivers/net/nfp/nfp_common.c > +++ b/drivers/net/nfp/nfp_common.c > @@ -280,10 +280,6 @@ nfp_set_mac_addr(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr) > return -EBUSY; > } > > - if ((hw->ctrl & NFP_NET_CFG_CTRL_ENABLE) && > - !(hw->cap & NFP_NET_CFG_CTRL_LIVE_ADDR)) > - return -EBUSY; > - > /* Writing new MAC to the specific port BAR address */ > nfp_net_write_mac(hw, (uint8_t *)mac_addr); > >