DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Marcin Wojtas <mw@semihalf.com>,
	Michal Krawczyk <mk@semihalf.com>,
	Shai Brandes <shaibran@amazon.com>,
	Evgeny Schemeilin <evgenys@amazon.com>,
	Igor Chauskin <igorch@amazon.com>
Cc: Ferruh Yigit <ferruh.yigit@intel.com>, dev@dpdk.org
Subject: [dpdk-dev] [PATCH] net/ena: remove useless address check
Date: Mon,  4 Oct 2021 18:27:02 +0100	[thread overview]
Message-ID: <20211004172702.3461360-1-ferruh.yigit@intel.com> (raw)

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>
---
Not clear about the intention of the check, removing it in this patch to
trigger the discussion.
---
 drivers/net/ena/ena_rss.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/ena/ena_rss.c b/drivers/net/ena/ena_rss.c
index 88afe13da04d..152098410fa2 100644
--- a/drivers/net/ena/ena_rss.c
+++ b/drivers/net/ena/ena_rss.c
@@ -136,8 +136,7 @@ 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;
 
 	if (!(dev->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH)) {
-- 
2.31.1


             reply	other threads:[~2021-10-04 17:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-04 17:27 Ferruh Yigit [this message]
2021-10-11  6:49 ` Michał Krawczyk
2021-10-11 15:49   ` Ferruh Yigit

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=20211004172702.3461360-1-ferruh.yigit@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=dev@dpdk.org \
    --cc=evgenys@amazon.com \
    --cc=igorch@amazon.com \
    --cc=mk@semihalf.com \
    --cc=mw@semihalf.com \
    --cc=shaibran@amazon.com \
    /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).