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 54EBC45D16; Fri, 15 Nov 2024 21:08:55 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BD2E3432D0; Fri, 15 Nov 2024 21:08:15 +0100 (CET) Received: from mail-pf1-f179.google.com (mail-pf1-f179.google.com [209.85.210.179]) by mails.dpdk.org (Postfix) with ESMTP id 194AE432A2 for ; Fri, 15 Nov 2024 21:08:09 +0100 (CET) Received: by mail-pf1-f179.google.com with SMTP id d2e1a72fcca58-71e953f4e7cso18290b3a.3 for ; Fri, 15 Nov 2024 12:08:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1731701288; x=1732306088; 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=VRTQFtO86lK9NIPw6Juok1U/Hn4+rH3IugoRpnJW+ng=; b=UkHAXm5axVUPXVX20A6WKGUApnF1Urxw2OzbchXtKrg4auHVeY5/0gjaVFyGCyt3rL C01l5WkQ96q1ssHwwUjGRFNh/JuNPiHmuiPaw/tfD319eCCT371cFUSPQWaziRo20w9z yUH/hi0IfcfEFKkezRQt0UtOKgQPB3ZUV7Srccn+p8DrdwVuLX+2hgSS1a3e6VjBlLt9 CMPrWqntEw1D7V0ofaZCwUjln5Z3MFlWBlhxALsxrOGvGaRJerbqpRAkCeLAaukTOIjx S1t+4UYCbtYfkvlYSp7rlPVeP/9TKvcXLtqabiMfuMxab/FkJfwALCIL60tm9WMnERE6 2EWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731701288; x=1732306088; 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=VRTQFtO86lK9NIPw6Juok1U/Hn4+rH3IugoRpnJW+ng=; b=VW9KSSMMtcKBAl6Vcj8OAq8pv9Zd77axywySbU/xNpXTSneaKHT/u55xHV0MKSb6+r 3CQp0k2e1NdCM5WuUwCPV8wuxa/bxHSZ+L6gG6JUQs843BH3wWJ1DXDc27Zaerrivy0+ NURDtZtYP/dL2/KDrjoAvzN3AXNTu5LOquUtww3fvZEKKbrtXNJ0ptKyrHndUs3AliNx gQuevCtFU19iuX+xdjuic0VJ1iDyGx5RrQlvDFvVePrvlqwVpPG5ZVrGrNp03GRAr2RL tF295VlVjC82V07vMjG1Y3+bF+DYx6uhLipFOwIrLXEN0NaiGueyRzJzO2DWfxNr3G9n H9ag== X-Gm-Message-State: AOJu0YyvexyxSGTiCWOXS85rPq2EpqhEB2Wg0cpEvLJlVx4ezPEWlisj 2S+TifJmP2yGQyxOGom9DYTo9JA2th7Z2GYQN53DgFJPsBdw9feO1vVgvVJVMNYLI5ffJqWkldU e X-Google-Smtp-Source: AGHT+IGcv5ANBzzXBGXK6So+tBs64Kb7gkvn0VZ+eBCxti+zxX4erD5FFVAH7rC64sFLFl+HpIB04g== X-Received: by 2002:a05:6a00:4b04:b0:71e:427a:68de with SMTP id d2e1a72fcca58-72476cefac1mr5395500b3a.24.1731701288319; Fri, 15 Nov 2024 12:08:08 -0800 (PST) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-724771e11f0sm1759686b3a.131.2024.11.15.12.08.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Nov 2024 12:08:07 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , haifeil@nvidia.com, Bruce Richardson , Aman Singh , Matan Azrad , Ajit Khaparde Subject: [PATCH v3 08/10] app/test-pmd: remove redundant condition Date: Fri, 15 Nov 2024 12:06:52 -0800 Message-ID: <20241115200751.17141-9-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241115200751.17141-1-stephen@networkplumber.org> References: <20241114001403.147609-1-stephen@networkplumber.org> <20241115200751.17141-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 Acked-by: Bruce Richardson --- 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