[v3,5/6] lpm: replace zero length array with flex array

Message ID 1709078215-20292-6-git-send-email-roretzla@linux.microsoft.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series more replacement of zero length array |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Tyler Retzlaff Feb. 27, 2024, 11:56 p.m. UTC
  Zero length arrays are GNU extension. Replace with
standard flex array.

Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
 lib/lpm/rte_lpm6.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Morten Brørup Feb. 28, 2024, 7:26 a.m. UTC | #1
> From: Tyler Retzlaff [mailto:roretzla@linux.microsoft.com]
> Sent: Wednesday, 28 February 2024 00.57
> 
> Zero length arrays are GNU extension. Replace with
> standard flex array.
> 
> Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
> ---

Reviewed-by: Morten Brørup <mb@smartsharesystems.com>
  

Patch

diff --git a/lib/lpm/rte_lpm6.c b/lib/lpm/rte_lpm6.c
index 271bc48..08fef82 100644
--- a/lib/lpm/rte_lpm6.c
+++ b/lib/lpm/rte_lpm6.c
@@ -106,7 +106,7 @@  struct rte_lpm6 {
 
 	struct rte_lpm_tbl8_hdr *tbl8_hdrs; /* array of tbl8 headers */
 
-	struct rte_lpm6_tbl_entry tbl8[0]
+	struct rte_lpm6_tbl_entry tbl8[]
 			__rte_cache_aligned; /**< LPM tbl8 table. */
 };