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 0C2BAA054F for ; Sat, 11 Jun 2022 00:09:50 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 036D340041; Sat, 11 Jun 2022 00:09:50 +0200 (CEST) Received: from stargate.chelsio.com (stargate.chelsio.com [12.32.117.8]) by mails.dpdk.org (Postfix) with ESMTP id 7878240041; Sat, 11 Jun 2022 00:09:48 +0200 (CEST) Received: from localhost (sicon-nithya-lt.asicdesigners.com [10.193.177.181] (may be forged)) by stargate.chelsio.com (8.14.7/8.14.7) with ESMTP id 25AM9kkk016672; Fri, 10 Jun 2022 15:09:47 -0700 From: Rahul Lakkireddy To: dev@dpdk.org Cc: gakhil@marvell.com, roy.fan.zhang@intel.com, stable@dpdk.org Subject: [PATCH] test/crypto: fix warnings for optimization=1 build Date: Sat, 11 Jun 2022 03:39:37 +0530 Message-Id: <872fbb13ed0df67f7dedbf3db340464bb7391af1.1654898453.git.rahul.lakkireddy@chelsio.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Skip IPSec ESN and antireplay cases, if there are no packets. Fixes following warning when using optimization=1 build flag with GCC 11. ../app/test/test_cryptodev.c: In function ‘test_ipsec_pkt_replay’: ../app/test/test_cryptodev.c:10074:15: warning: ‘td_outb’ may be used uninitialized [-Wmaybe-uninitialized] ret = test_ipsec_proto_process(td_outb, td_inb, nb_pkts, true, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ &flags); ~~~~~~~ ../app/test/test_cryptodev.c:9150:1: note: by argument 1 of type ‘const struct ipsec_test_data[]’ to ‘test_ipsec_proto_process’ declared here test_ipsec_proto_process(const struct ipsec_test_data td[], ^~~~~~~~~~~~~~~~~~~~~~~~ ../app/test/test_cryptodev.c:10056:32: note: ‘td_outb’ declared here struct ipsec_test_data td_outb[IPSEC_TEST_PACKETS_MAX]; ^~~~~~~ Fixes: d02c6bfcb99a ("test/crypto: add ESN and antireplay cases") Cc: stable@dpdk.org Signed-off-by: Rahul Lakkireddy --- app/test/test_cryptodev.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c index 524019ce0e..47ce3d8420 100644 --- a/app/test/test_cryptodev.c +++ b/app/test/test_cryptodev.c @@ -10058,6 +10058,9 @@ test_ipsec_pkt_replay(const void *test_data, const uint64_t esn[], struct ipsec_test_flags flags; uint32_t i = 0, ret = 0; + if (nb_pkts == 0) + return TEST_SKIPPED; + memset(&flags, 0, sizeof(flags)); flags.antireplay = true; -- 2.27.0