Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1461487pxv; Fri, 2 Jul 2021 04:31:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwm2ttupMtf5ShzSseHdSoFsi/BY8QzWGhoSbaVxmzmjNl7Di5sITH50Pgo3OsYenwigkKL X-Received: by 2002:aa7:c686:: with SMTP id n6mr6107435edq.0.1625225481331; Fri, 02 Jul 2021 04:31:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625225481; cv=none; d=google.com; s=arc-20160816; b=NsA2svXdakxOA5j47wcm+nDC91Lj++qScv2+yRFz2AzZ+jaIIApCT6l2xN0GsdV78a 27j+HI4zfiFCM6GbhmpubSfHXpeJ2WXuVD80jFtfCnLT1Zhceq35yN19a3ZoJDl8mGz3 GU9F9sm3OxP9Tii9CMQ128EisRtl0AIFkVQQVq494qYFaSL0Mp/KKO+T+q4FW5KJyto0 BA0OOAoE+kntkxbvlPlyDBQAvIokutS31ibBmIPWxwf0pJJLrs4nCs4Mg1PCkItEqosD hy66Hffmsyp7tF8XqlPr0CH2qrHivmSCmE6K3kdINoEOO5kpCV2xQ39wNrylEf4vObv1 OO0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=R7ftCDekX/PgyBkSTL6UCMl3CfN4Dl8YsRAfIcRejqY=; b=N+6VM5nv6ZtNBu8MwtdrQ0WZEuTo3urXusAvcUu65RdgDaMT4rv+UzfipvQfILt/4s 3VMGBbuTMDaLeBxNPsCbQh5NPW3QqEwdmybq3yod2sVn5CqIOwj3h8Z3deJH8eoaNhBI d1hF8MJEPRp7Vdk280yv3OWHZr1Vx6TKLDNUcou7qjChBM/52p59XVo1XzbOBDAZ4jQ0 +K7/k8/UZGaNfTL04/EEkyRTQrQx0gm7S2sW3SQeBNqn6WtNTN82OM1wCw+4ttxJlRaD DaLleZDhrbECkSKVaZcXQPAulqyfSyGA0/zSQrxVEVXePb37JblGCVCbJS+bRFiqXGTQ KJuw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s24si3055392ejs.124.2021.07.02.04.30.55; Fri, 02 Jul 2021 04:31:21 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231880AbhGBL37 (ORCPT + 99 others); Fri, 2 Jul 2021 07:29:59 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:58721 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231145AbhGBL36 (ORCPT ); Fri, 2 Jul 2021 07:29:58 -0400 Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1lzHKK-0003x3-Lf; Fri, 02 Jul 2021 11:27:20 +0000 From: Colin King To: Jesse Brandeburg , Tony Nguyen , Jakub Kicinski , intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] iavf: remove redundant null check on key Date: Fri, 2 Jul 2021 12:27:20 +0100 Message-Id: <20210702112720.16006-1-colin.king@canonical.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Colin Ian King The null check on pointer key has already been performed at the start of the function and this leads to a return of -EOPNOTSUPP. The second null check on key is therefore always false, it is redundant and can be removed. Addresses-Coverity: ("Logically dead code") Signed-off-by: Colin Ian King --- drivers/net/ethernet/intel/iavf/iavf_ethtool.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/ethernet/intel/iavf/iavf_ethtool.c b/drivers/net/ethernet/intel/iavf/iavf_ethtool.c index af43fbd8cb75..70193d8d54ed 100644 --- a/drivers/net/ethernet/intel/iavf/iavf_ethtool.c +++ b/drivers/net/ethernet/intel/iavf/iavf_ethtool.c @@ -1873,8 +1873,7 @@ static int iavf_set_rxfh(struct net_device *netdev, const u32 *indir, if (!indir) return 0; - if (key) - memcpy(adapter->rss_key, key, adapter->rss_key_size); + memcpy(adapter->rss_key, key, adapter->rss_key_size); /* Each 32 bits pointed by 'indir' is stored with a lut entry */ for (i = 0; i < adapter->rss_lut_size; i++) -- 2.31.1