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 60DADA00C2 for ; Thu, 8 Dec 2022 15:55:47 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 36D3B40E28; Thu, 8 Dec 2022 15:55:47 +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 AA4D940A7E for ; Thu, 8 Dec 2022 15:55:45 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1670511345; 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; bh=9O10sD78oZqvphwbcmoXYqgC5BfFpbIE5e0G2NsEYnw=; b=En9q0egWBrvuHbwqOOKTjokMXDn66JZXPgFLUbDGZqzGj0RePwZtLBFOmsBfz+b/FtbCfv ICkSs9Iy6BOOQCqaylKORqJgN7+fGR/V8dV1NqV8FLLMdmoPz+Pisgb5Spl+TBOrjcVyND 0F8YrCLk3WNa3cFxqLAp/q5om1U9dtE= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-414-NaexrA03MLW8oTZYkxFCQA-1; Thu, 08 Dec 2022 09:55:44 -0500 X-MC-Unique: NaexrA03MLW8oTZYkxFCQA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 99B30806004; Thu, 8 Dec 2022 14:55:43 +0000 (UTC) Received: from localhost.localdomain (ovpn-194-246.brq.redhat.com [10.40.194.246]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9D64D2024CC0; Thu, 8 Dec 2022 14:55:42 +0000 (UTC) From: David Marchand To: stable@dpdk.org Cc: bluca@debian.org, Ferruh Yigit , Michal Krawczyk Subject: [PATCH 20.11 1/4] net/ena: remove useless address check Date: Thu, 8 Dec 2022 15:49:07 +0100 Message-Id: <20221208144910.360883-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org From: Ferruh Yigit [ upstream commit 7a4edfd7bbcd0a3bcb726bc8a109419a600273be ] Reported by "gcc (GCC) 12.0.0 20211003 (experimental)": ./drivers/net/ena/ena_rss.c: In function ‘ena_rss_reta_query’: ./drivers/net/ena/ena_rss.c:140:66: error: the comparison will always evaluate as ‘false’ for the pointer operand in ‘reta_conf + 136’ must not be NULL [-Werror=address] 140 | (reta_size > RTE_RETA_GROUP_SIZE && ((reta_conf + 1) == NULL))) | ^~ Fixing it by removing useless check. Signed-off-by: Ferruh Yigit Acked-by: Michal Krawczyk Signed-off-by: David Marchand --- Note on backport: - moved change to ena_ethdev.c, --- drivers/net/ena/ena_ethdev.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c index 64e38e49fa..a4aac5a892 100644 --- a/drivers/net/ena/ena_ethdev.c +++ b/drivers/net/ena/ena_ethdev.c @@ -643,8 +643,7 @@ static int ena_rss_reta_query(struct rte_eth_dev *dev, int reta_conf_idx; int reta_idx; - if (reta_size == 0 || reta_conf == NULL || - (reta_size > RTE_RETA_GROUP_SIZE && ((reta_conf + 1) == NULL))) + if (reta_size == 0 || reta_conf == NULL) return -EINVAL; rte_spinlock_lock(&adapter->admin_lock); -- 2.38.1