DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] eventdev: fix telemetry Rx adapters stats reset
@ 2022-03-24 15:28 David Marchand
  2022-03-25  9:32 ` Jayatheerthan, Jay
  0 siblings, 1 reply; 3+ messages in thread
From: David Marchand @ 2022-03-24 15:28 UTC (permalink / raw)
  To: dev
  Cc: stable, Jay Jayatheerthan, Jerin Jacob, Naga Harish K S V,
	Ganapati Kundapura

Caught by covscan:

1. dpdk-21.11/lib/eventdev/rte_event_eth_rx_adapter.c:3279:
logical_vs_bitwise: "~(*__ctype_b_loc()[(int)*params] & 2048 /*
(unsigned short)_ISdigit */)" is always 1/true regardless of the values
of its operand. This occurs as the logical second operand of "||".
2. dpdk-21.11/lib/eventdev/rte_event_eth_rx_adapter.c:3279: remediation:
Did you intend to use "!" rather than "~"?

While isdigit return value should be compared as an int to 0,
prefer ! since all of this file uses this convention.

Fixes: 814d01709328 ("eventdev/eth_rx: support telemetry")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 lib/eventdev/rte_event_eth_rx_adapter.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/eventdev/rte_event_eth_rx_adapter.c b/lib/eventdev/rte_event_eth_rx_adapter.c
index ff83ce8b67..bf8741d2ea 100644
--- a/lib/eventdev/rte_event_eth_rx_adapter.c
+++ b/lib/eventdev/rte_event_eth_rx_adapter.c
@@ -3334,7 +3334,7 @@ handle_rxa_stats_reset(const char *cmd __rte_unused,
 {
 	uint8_t rx_adapter_id;
 
-	if (params == NULL || strlen(params) == 0 || ~isdigit(*params))
+	if (params == NULL || strlen(params) == 0 || !isdigit(*params))
 		return -1;
 
 	/* Get Rx adapter ID from parameter string */
-- 
2.23.0


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

end of thread, other threads:[~2022-05-10 14:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-24 15:28 [PATCH] eventdev: fix telemetry Rx adapters stats reset David Marchand
2022-03-25  9:32 ` Jayatheerthan, Jay
2022-05-10 14:35   ` Jerin Jacob

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