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 2E2C745D16; Fri, 15 Nov 2024 21:08:29 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C9E7D432AA; Fri, 15 Nov 2024 21:08:09 +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 6FD1E43289 for ; Fri, 15 Nov 2024 21:08:05 +0100 (CET) Received: by mail-pf1-f179.google.com with SMTP id d2e1a72fcca58-7242f559a9fso2221257b3a.1 for ; Fri, 15 Nov 2024 12:08:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1731701284; x=1732306084; 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=XP/lHA+mlG+8s/+KLiYXa3x8Kpux40ef/SS9hM64EtY=; b=qijZyEwmYZJg9D6rIZeJu/dgJDm7V2rJjmFgIrAdp3OdsXNBYbG+4Fd2YPOYlS4CDe eHM3pIoyVIBeKUJhcIZ5SwvpOx1zkqeLYhBlHxfWLEY51cbR2W2oviniexwVUklp81y9 E4DogqmfXPQTF6+acRfaDD3j7DktPXnPvKGNlMbDuIUIFZ/syPgilQLGU1aeD5rUW+HY iR+2hmSSAQvVfqgLyYTyq0MINY4gucecVJ/bsefn1FZHJXOnfg4gSLzDL4ZrXhOCzikq ogSHyGLEzyoZw7SHPuvWTA7t4yUEmhc1WJsvK+hSz69ST+KeSJ/xHxgnyY3k6NX8hoRd 1mVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731701284; x=1732306084; 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=XP/lHA+mlG+8s/+KLiYXa3x8Kpux40ef/SS9hM64EtY=; b=tA2thSkh8G12V7AcnZ5pe/aUMlxqxrB4Svg7TnKLES7Oxoey+P3bMWRXUitrO+Xaw8 sQsyAMjWfRyavvuOhLkZUxrFWIG/5Mm5MSWEJ/ZE/Vc7N0HpHigkyulJYBIJTm3fgTP4 a3F7Dg4cXJkWxjvc2rCuIMyH6RC2OsDhkwo8Aif4osGyRNAVP56FFU8gOv3IZX/b1i9j 4y0ScbOq1F5VLsSyrBPIgDPjvviLPIi8TykwRZgJhxpmLf2L0sDQfkkAnizqINUSNZ46 OilNkrMOpKd+UMfzLDExfSJxWY+ckdDPQlUH8vHnrQ3jO0Ou/oGb08suGtrtruqbNhwf RoUQ== X-Gm-Message-State: AOJu0YzsIqfvLxuq27chNEdgfxwqpuDjtMIyPZkQjHKn8oLPHkrZXuTl b2vd57GpPGMIELojPvEUSYS6oaGONEnNjDmh/BA6Nx6cYcTVss9O+khlKHzB+1WfPh3qpHwRx6X n X-Google-Smtp-Source: AGHT+IFNVv3CyvPQgrXYiIPd1ImB5sv6kMGG///V5OMo402f51YKMhB+6jNRavg8AXXec0zN5w83ZQ== X-Received: by 2002:a05:6a00:2193:b0:724:603f:1f9c with SMTP id d2e1a72fcca58-72476d15210mr4578569b3a.16.1731701284655; Fri, 15 Nov 2024 12:08:04 -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.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Nov 2024 12:08:04 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , jerin.jacob@caviumnetworks.com, Bruce Richardson , Abhinandan Gujjar Subject: [PATCH v3 04/10] app/test: avoid duplicate initialization Date: Fri, 15 Nov 2024 12:06:48 -0800 Message-ID: <20241115200751.17141-5-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 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 Acked-by: Bruce Richardson --- 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