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 F20D045CC3; Thu, 14 Nov 2024 20:26:42 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BC7FD42F0F; Thu, 14 Nov 2024 20:26:24 +0100 (CET) Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) by mails.dpdk.org (Postfix) with ESMTP id 57B3C42EE3 for ; Thu, 14 Nov 2024 20:26:19 +0100 (CET) Received: by mail-pl1-f180.google.com with SMTP id d9443c01a7336-20caea61132so9154195ad.2 for ; Thu, 14 Nov 2024 11:26:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1731612378; x=1732217178; 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=Hb2Vb3vSP+AW6E8/io5Cdc8yJa0ePhS2WwpQB51e5C0=; b=HKkLlcVx3sQChLNU3wvDZCOMvGmPIn617DuF9ZncsyGWjZRo1RI+q7Ug6aBuqSzfpS +iNHi7OkFQrvBrS5kpexp04xp3NXiGxiyyTTMSz1+pb9lfXi26p664Zw6lybzIg2uRTf JQ9Ws9UwuUVnI+aBDjv2P+NUrL9tOmygtnwD2pnerBrESZ3YXjkDwOwTX1fn2X47ehFc 0sUQ4akZia6W2V71nNa39VDdMR3cACZlTor0FiZyWNh0L3/sg7RAVTBM22eIMnU+CqFS VWDjK3liyFFWxcy1q0kjQo/wHuYSEDjyFkx9SxVh3M8GStuzLrV2nu+cPIsLLKrNHmph hAuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731612378; x=1732217178; 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=Hb2Vb3vSP+AW6E8/io5Cdc8yJa0ePhS2WwpQB51e5C0=; b=mukj7oT4Z0/P7QVpv5ovQpWXnHVHnE+6ejC9wYuWknXprxlbCktngKQIuHB6aBg/II TQBH9jhWRcv67fnyK39JWVoUK9LNLGdevBiAwq23pKlP3zPbM2oA34Qp42XerO1FEE6A 7/lYUCnm9T2yX4uzObbThrzWBhn/PtnUaeCwcEeGlMmBAxVXF1rgdpnSXQDFoFtU7YAO 7+yKJ0X3keNAfNvj/aCnEPchEFr2lCz+L3mZpZs229eA1oX4sQp7Yu/Q0TmCUDyUWJ2L FPgxDRjMQQnLyiehUulkqz72OfBLwc/ns/4wANKvMKiIbj6/0QbQoYAGse9wyA5wDLEE rvXQ== X-Gm-Message-State: AOJu0YwbvT4ZXhKLM19BH6PGR7cdylRLkDuEAwrl/JyOAv4/bHk7/VVF 7O7Dh7O8gU3EIVmOm+qv1QH+7xjXy7n4OBhY9IEOxoUThL2jdLcLIEuez4/7s5WOqcDMuKu/w74 Yfmg= X-Google-Smtp-Source: AGHT+IGuOShLsSV76QQF2ptZ9HC5jpvrBVfMBzv4IClDwTB9kcmwQ8esSgeVF1txdp4bmTPTEzUXNg== X-Received: by 2002:a05:6a21:78a0:b0:1db:ef4b:d164 with SMTP id adf61e73a8af0-1dc83450211mr4580256637.32.1731612378525; Thu, 14 Nov 2024 11:26:18 -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.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Nov 2024 11:26:17 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , jerin.jacob@caviumnetworks.com, Abhinandan Gujjar , Bruce Richardson Subject: [PATCH v2 04/10] app/test: avoid duplicate initialization Date: Thu, 14 Nov 2024 11:25:02 -0800 Message-ID: <20241114192603.41145-5-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 event_dev_config initialization had duplicate assignments to the same element. Change to use structure initialization so that compiler will catch this type of bug. Link: https://pvs-studio.com/en/blog/posts/cpp/1179/ Fixes: f8f9d233ea0e ("test/eventdev: add unit tests") Cc: jerin.jacob@caviumnetworks.com Signed-off-by: Stephen Hemminger --- app/test/test_event_crypto_adapter.c | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/app/test/test_event_crypto_adapter.c b/app/test/test_event_crypto_adapter.c index 9d38a66bfa..ab24e30a97 100644 --- a/app/test/test_event_crypto_adapter.c +++ b/app/test/test_event_crypto_adapter.c @@ -1154,21 +1154,17 @@ configure_cryptodev(void) static inline void evdev_set_conf_values(struct rte_event_dev_config *dev_conf, - struct rte_event_dev_info *info) + const struct rte_event_dev_info *info) { - memset(dev_conf, 0, sizeof(struct rte_event_dev_config)); - dev_conf->dequeue_timeout_ns = info->min_dequeue_timeout_ns; - dev_conf->nb_event_ports = NB_TEST_PORTS; - dev_conf->nb_event_queues = NB_TEST_QUEUES; - dev_conf->nb_event_queue_flows = info->max_event_queue_flows; - dev_conf->nb_event_port_dequeue_depth = - info->max_event_port_dequeue_depth; - dev_conf->nb_event_port_enqueue_depth = - info->max_event_port_enqueue_depth; - dev_conf->nb_event_port_enqueue_depth = - info->max_event_port_enqueue_depth; - dev_conf->nb_events_limit = - info->max_num_events; + *dev_conf = (struct rte_event_dev_config) { + .dequeue_timeout_ns = info->min_dequeue_timeout_ns, + .nb_event_ports = NB_TEST_PORTS, + .nb_event_queues = NB_TEST_QUEUES, + .nb_event_queue_flows = info->max_event_queue_flows, + .nb_event_port_dequeue_depth = info->max_event_port_dequeue_depth, + .nb_event_port_enqueue_depth = info->max_event_port_enqueue_depth, + .nb_events_limit = info->max_num_events, + }; } static int -- 2.45.2