patches for DPDK stable branches
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@redhat.com>
To: stable@dpdk.org
Cc: bluca@debian.org, Ferruh Yigit <ferruh.yigit@intel.com>,
	Michal Krawczyk <mk@semihalf.com>
Subject: [PATCH 20.11 1/4] net/ena: remove useless address check
Date: Thu,  8 Dec 2022 15:49:07 +0100	[thread overview]
Message-ID: <20221208144910.360883-1-david.marchand@redhat.com> (raw)

From: Ferruh Yigit <ferruh.yigit@intel.com>

[ 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 <ferruh.yigit@intel.com>
Acked-by: Michal Krawczyk <mk@semihalf.com>
Signed-off-by: David Marchand <david.marchand@redhat.com>
---
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


             reply	other threads:[~2022-12-08 14:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-08 14:49 David Marchand [this message]
2022-12-08 14:49 ` [PATCH 20.11 2/4] net/ena: fix build with GCC 12 David Marchand
2022-12-08 14:49 ` [PATCH 20.11 3/4] net/qede: fix minsize build David Marchand
2022-12-08 14:49 ` [PATCH 20.11 4/4] crypto/ipsec_mb: fix build with GCC 12 David Marchand
2022-12-08 16:55 ` [PATCH 20.11 1/4] net/ena: remove useless address check Luca Boccassi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221208144910.360883-1-david.marchand@redhat.com \
    --to=david.marchand@redhat.com \
    --cc=bluca@debian.org \
    --cc=ferruh.yigit@intel.com \
    --cc=mk@semihalf.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).