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 97489456AC; Thu, 25 Jul 2024 19:18:02 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 84A2F432CC; Thu, 25 Jul 2024 19:18:02 +0200 (CEST) Received: from mail-pg1-f178.google.com (mail-pg1-f178.google.com [209.85.215.178]) by mails.dpdk.org (Postfix) with ESMTP id C1BD4402AB for ; Thu, 25 Jul 2024 19:16:22 +0200 (CEST) Received: by mail-pg1-f178.google.com with SMTP id 41be03b00d2f7-7928d2abe0aso44278a12.0 for ; Thu, 25 Jul 2024 10:16:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1721927782; x=1722532582; darn=dpdk.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=LtT9iUyxTN3xlF1akMjSyaUhgmNjv5+IPsFwuYZ9ue4=; b=m1uPicgYrGL69fU733YZwQVfhTC8f1oBU5hvpwvVQd4vpDIb0X1l7ujoHpqrlkmeGm sYqw+LCscNIeVwzR+v/ps7ELN/Ch8ry4Hbus7/0ZHF2RlgMLVOCwB9plKTY14ltIUzU8 u0YqXRB20F8/Q7YdTWuWYkMsWk00pn8FBbhE6ymlQtTuFq+1/z5tGLyKCbFuLdPwlHym ofGCPpT1dbtLW2OK3iVilsDp/ZX96CiRGag8dHL2dfdVOBlUaewET4Frt0CwV1pWV8gv 0JdfIazv/TszQi0bSskD84b7C+63532kWwAJTpfrwvt5GbXSZ/S2suz7tTILsyN4CDaD tlgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721927782; x=1722532582; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=LtT9iUyxTN3xlF1akMjSyaUhgmNjv5+IPsFwuYZ9ue4=; b=lfXhsdtyAAgXqg85ZQld8wqIdjzrQo0f2mFKXtmZVtkMxGzvknJlZTXehdP+PW5qHU fv7FCulcOfxhC6L2SxkQqNs8XRkkMqAt2c94YLcFIjURW7INdzqc6PqmfqBf14qkBGq1 saWiKeCCX6i8QxdrZVGuZ6f5tAETai0uzy3re5DG5HxEZP4I/8cZDzEWdzuoj6gijSdZ mU/jrQtWhXrK/jZ3ON47026PAaeyxJWCMp3juSOJvaXW40ocyqV8rW/6ZVteiqAKInMQ sgktGNuz2odQJ4y5SkzoFGJwI4CGrNVe6DYFfSh2sRRvu1TSSrhsvxNw4UNlCZXlSvyI LMsg== X-Gm-Message-State: AOJu0YxPqrQuMdEQF42J0dsVBNRUpRd89JOd3ct7L+LYFsCd4TWkJkEz H1TMSHHYED6JIS8Q0nY0iq/hyJjSuYRGftWGlEepjsZ4frGucdgXrhjkZ1RdLWd4o0BeNXS6Qsh Y X-Google-Smtp-Source: AGHT+IGGSiQwfRZimj0XTU9f7dVcxXmJbve4jVSgGKkwkvMB4KYoZI1wi68Cz5PQQHnStz/VkwMbGQ== X-Received: by 2002:a05:6a20:12d2:b0:1c4:779b:fb02 with SMTP id adf61e73a8af0-1c4779bfecdmr4976322637.21.1721927781742; Thu, 25 Jul 2024 10:16:21 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-70ead8140bcsm1398895b3a.99.2024.07.25.10.16.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 10:16:21 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Liang Ma , Peter Mccarthy , Harry van Haaren , Amit Prakash Shukla , Jerin Jacob Subject: [PATCH] eventdev: do not use zero length arrays Date: Thu, 25 Jul 2024 10:15:27 -0700 Message-ID: <20240725171609.142344-1-stephen@networkplumber.org> X-Mailer: git-send-email 2.43.0 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 Zero length array's are a GNU C extension and should be replaced by use of flexible arrayrs. This has been fixed almost everywhere in DPDK 24.07 but looks like some event code got missed. Generated by devtools/cocci/zero_length_array.cocci Signed-off-by: Stephen Hemminger --- drivers/event/opdl/opdl_ring.c | 2 +- drivers/event/sw/event_ring.h | 2 +- lib/eventdev/rte_event_dma_adapter.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/event/opdl/opdl_ring.c b/drivers/event/opdl/opdl_ring.c index 6799ec996b..60991c4b03 100644 --- a/drivers/event/opdl/opdl_ring.c +++ b/drivers/event/opdl/opdl_ring.c @@ -119,7 +119,7 @@ struct opdl_ring { /* Stages indexed by ID */ struct opdl_stage *stages; /* Memory for storing slot data */ - alignas(RTE_CACHE_LINE_SIZE) uint8_t slots[0]; + alignas(RTE_CACHE_LINE_SIZE) uint8_t slots[]; }; diff --git a/drivers/event/sw/event_ring.h b/drivers/event/sw/event_ring.h index 29db267b77..35931888dd 100644 --- a/drivers/event/sw/event_ring.h +++ b/drivers/event/sw/event_ring.h @@ -27,7 +27,7 @@ struct rob_ring { uint32_t size; uint32_t write_idx; uint32_t read_idx; - alignas(RTE_CACHE_LINE_SIZE) void *ring[0]; + alignas(RTE_CACHE_LINE_SIZE) void *ring[]; }; static inline struct rob_ring * diff --git a/lib/eventdev/rte_event_dma_adapter.h b/lib/eventdev/rte_event_dma_adapter.h index 768390cd30..5c480b82ff 100644 --- a/lib/eventdev/rte_event_dma_adapter.h +++ b/lib/eventdev/rte_event_dma_adapter.h @@ -204,7 +204,7 @@ struct rte_event_dma_adapter_op { /**< Number of source segments. */ uint16_t nb_dst; /**< Number of destination segments. */ - struct rte_dma_sge src_dst_seg[0]; + struct rte_dma_sge src_dst_seg[]; /**< Source and destination segments. */ }; -- 2.43.0