From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2BBA5A04FF for ; Thu, 24 Mar 2022 16:28:39 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 24F5A40683; Thu, 24 Mar 2022 16:28:39 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 9CF7A40683 for ; Thu, 24 Mar 2022 16:28:37 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1648135717; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZQAS18SAYVyzeh06zYXFyktqlnnhvFOkAXL3Pqb1pm8=; b=CPblMkn8yDrqW1ntbJvvrNX8gjr5HCeJXByq9LaCWkm36QwYD+EqLNJFTdqABtbjY3jdYU t+UE777Zr+nPdw6KrTrUNvfnbHAkjoub0P6xYvxnKqUQVH7m/fYm1VQyN7wulZAUgeL2hT TWpWX0zgFNO21rgBQ6jhyA+P+SJfdSA= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-55-5GRZvgwvPcGktkAiImZTSQ-1; Thu, 24 Mar 2022 11:28:35 -0400 X-MC-Unique: 5GRZvgwvPcGktkAiImZTSQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 624AF185A7B2; Thu, 24 Mar 2022 15:28:35 +0000 (UTC) Received: from dmarchan.remote.csb (unknown [10.40.195.27]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2639C40D296B; Thu, 24 Mar 2022 15:28:34 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: stable@dpdk.org, Jay Jayatheerthan , Jerin Jacob , Naga Harish K S V , Ganapati Kundapura Subject: [PATCH] eventdev: fix telemetry Rx adapters stats reset Date: Thu, 24 Mar 2022 16:28:30 +0100 Message-Id: <20220324152830.28155-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=david.marchand@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org 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 --- 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