Skip to content

Commit

Permalink
eventdev/eth_rx: fix telemetry Rx stats reset
Browse files Browse the repository at this point in the history
[ upstream commit b450a99 ]

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: 814d017 ("eventdev/eth_rx: support telemetry")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Jay Jayatheerthan <jay.jayatheerthan@intel.com>
  • Loading branch information
david-marchand authored and kevintraynor committed May 25, 2022
1 parent ec08dca commit 09d8595
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/eventdev/rte_event_eth_rx_adapter.c
Expand Up @@ -3314,7 +3314,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 */
Expand Down

0 comments on commit 09d8595

Please sign in to comment.