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 D5E4845CC3; Thu, 14 Nov 2024 20:27:07 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4AC2142F45; Thu, 14 Nov 2024 20:26:30 +0100 (CET) Received: from mail-ot1-f54.google.com (mail-ot1-f54.google.com [209.85.210.54]) by mails.dpdk.org (Postfix) with ESMTP id 404A742F0A for ; Thu, 14 Nov 2024 20:26:24 +0100 (CET) Received: by mail-ot1-f54.google.com with SMTP id 46e09a7af769-7181285c7c4so572234a34.0 for ; Thu, 14 Nov 2024 11:26:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1731612383; x=1732217183; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=V7BoOSRMcB41TxT9hCgHuA+T+3RNhORnxBMubQ2BvNE=; b=Z7VHJWmXpfGgEQSe4+pnbheYa+y4pyY+Osemb3hoJl0oNhsgwty4IBqN/uRrJTil7a DwOVpwCxvUuHDR/t6Iqr7CUZ88b8RdaY+teZMK6Ro5XvVdOQPes4o7f3T9mpvO98/mRg 0EtgmusAojIdLaze+dl1fJcf1DPkc2lz1u3L+iyJEHsGOfcyQFL0pAKxx8Amet+fPzvD Ntjh/QWrSOtvT5ELiJNUCUNyDP0NCNVtLH75R0Eg8PcrLWr/vbvjK8JPpdjTcsm9dPPE 2yHxv6+yP2eGT4cvxCxyVdO+J+nFMLnExwXwB444OXTooGYrNzJn4JglTkx3iyoUkR22 AEGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731612383; x=1732217183; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=V7BoOSRMcB41TxT9hCgHuA+T+3RNhORnxBMubQ2BvNE=; b=Xr9/7aRnKAufgdHxGJMCcG/6tivtj3F1dwivVeLwENrDSptGq5sgKoGG6f6rN7YyYD lwfRxEZQVC7Wy84qjbnbXnyVC8BHkmmjMWhCPw4HALscorU1SZmkdQ9+NC1SG/JM1PQH mNphSZ8BPWTDw0MQtE3l+MFwsHwzVn1dtYgeJ+HOtk/BAFCg/ZaO+ayQ9aQXV5TlyPNu mevKqqO0RFKAlTkdpD7kkut8hMjzhubQd2Hs81KYck4KNlVBhHN335xSxAjKXvuIdPHq P+CzAr5qBKCS0PkghAAv5dpVEhos40ZNYghTsbTFr0m2BFxH//ER0/vazXKs3hv2bZBM 90eA== X-Gm-Message-State: AOJu0YwW/F+7/F3h/H4twPfG8X+tuwpkcN+hpo5PN+uLpgSEfHTsKjWt BEr6ZgD7vj2nKV0pLbjXLKZrXkkVvjOgrT9561z9Dd0z+1F0kxlyQu+6Lu9B0ZCb7O6dxJGv0yz 6WDU= X-Google-Smtp-Source: AGHT+IFHvVhiqNAbNUMX5hJzlPjJDvfBB3Tfu1nNUsLV8yxXFL34iY9jUcaMCrQ/K5RcrVn+CqR/8w== X-Received: by 2002:a05:6830:381a:b0:718:4073:62bf with SMTP id 46e09a7af769-71a7798c82emr163450a34.7.1731612383391; Thu, 14 Nov 2024 11:26:23 -0800 (PST) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7f8b37f3466sm1461632a12.35.2024.11.14.11.26.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Nov 2024 11:26:22 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , haifeil@nvidia.com, Aman Singh , Ajit Khaparde , Matan Azrad Subject: [PATCH v2 08/10] app/test-pmd: remove redundant condition Date: Thu, 14 Nov 2024 11:25:06 -0800 Message-ID: <20241114192603.41145-9-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241114192603.41145-1-stephen@networkplumber.org> References: <20241114001403.147609-1-stephen@networkplumber.org> <20241114192603.41145-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org The loop over policy actions will always exit when it sees the flow end action, so the next check is redundant. Link: https://pvs-studio.com/en/blog/posts/cpp/1179/ Fixes: f29fa2c59b85 ("app/testpmd: support policy actions per color") Cc: haifeil@nvidia.com Signed-off-by: Stephen Hemminger --- app/test-pmd/config.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index 88770b4dfc..32c4e86c84 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -2288,7 +2288,7 @@ port_meter_policy_add(portid_t port_id, uint32_t policy_id, for (act_n = 0, start = act; act->type != RTE_FLOW_ACTION_TYPE_END; act++) act_n++; - if (act_n && act->type == RTE_FLOW_ACTION_TYPE_END) + if (act_n > 0) policy.actions[i] = start; else policy.actions[i] = NULL; @@ -7316,4 +7316,3 @@ show_mcast_macs(portid_t port_id) printf(" %s\n", buf); } } - -- 2.45.2