DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/ena: remove useless address check
@ 2021-10-04 17:27 Ferruh Yigit
  2021-10-11  6:49 ` Michał Krawczyk
  0 siblings, 1 reply; 3+ messages in thread
From: Ferruh Yigit @ 2021-10-04 17:27 UTC (permalink / raw)
  To: Marcin Wojtas, Michal Krawczyk, Shai Brandes, Evgeny Schemeilin,
	Igor Chauskin
  Cc: Ferruh Yigit, dev

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-10-11 15:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-04 17:27 [dpdk-dev] [PATCH] net/ena: remove useless address check Ferruh Yigit
2021-10-11  6:49 ` Michał Krawczyk
2021-10-11 15:49   ` Ferruh Yigit

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).