[v5,3/6] fib: replace zero length array with flex array

Message ID 1709756036-24068-4-git-send-email-roretzla@linux.microsoft.com (mailing list archive)
State Accepted, archived
Delegated to: David Marchand
Headers
Series more replacement of zero length array |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Tyler Retzlaff March 6, 2024, 8:13 p.m. UTC
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>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/fib/dir24_8.h | 2 +-
 lib/fib/trie.h    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
  

Comments

Medvedkin, Vladimir March 6, 2024, 8:53 p.m. UTC | #1
Acked-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>

On 06/03/2024 20:13, Tyler Retzlaff wrote:
> 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>
> Acked-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
>   lib/fib/dir24_8.h | 2 +-
>   lib/fib/trie.h    | 2 +-
>   2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/lib/fib/dir24_8.h b/lib/fib/dir24_8.h
> index 6d350f7..7125049 100644
> --- a/lib/fib/dir24_8.h
> +++ b/lib/fib/dir24_8.h
> @@ -34,7 +34,7 @@ struct dir24_8_tbl {
>   	uint64_t	*tbl8;		/**< tbl8 table. */
>   	uint64_t	*tbl8_idxes;	/**< bitmap containing free tbl8 idxes*/
>   	/* tbl24 table. */
> -	__extension__ alignas(RTE_CACHE_LINE_SIZE) uint64_t	tbl24[0];
> +	alignas(RTE_CACHE_LINE_SIZE) uint64_t	tbl24[];
>   };
>   
>   static inline void *
> diff --git a/lib/fib/trie.h b/lib/fib/trie.h
> index 36ce1fd..2c20184 100644
> --- a/lib/fib/trie.h
> +++ b/lib/fib/trie.h
> @@ -38,7 +38,7 @@ struct rte_trie_tbl {
>   	uint32_t	*tbl8_pool;	/**< bitmap containing free tbl8 idxes*/
>   	uint32_t	tbl8_pool_pos;
>   	/* tbl24 table. */
> -	__extension__ alignas(RTE_CACHE_LINE_SIZE) uint64_t	tbl24[0];
> +	alignas(RTE_CACHE_LINE_SIZE) uint64_t	tbl24[];
>   };
>   
>   static inline uint32_t
  

Patch

diff --git a/lib/fib/dir24_8.h b/lib/fib/dir24_8.h
index 6d350f7..7125049 100644
--- a/lib/fib/dir24_8.h
+++ b/lib/fib/dir24_8.h
@@ -34,7 +34,7 @@  struct dir24_8_tbl {
 	uint64_t	*tbl8;		/**< tbl8 table. */
 	uint64_t	*tbl8_idxes;	/**< bitmap containing free tbl8 idxes*/
 	/* tbl24 table. */
-	__extension__ alignas(RTE_CACHE_LINE_SIZE) uint64_t	tbl24[0];
+	alignas(RTE_CACHE_LINE_SIZE) uint64_t	tbl24[];
 };
 
 static inline void *
diff --git a/lib/fib/trie.h b/lib/fib/trie.h
index 36ce1fd..2c20184 100644
--- a/lib/fib/trie.h
+++ b/lib/fib/trie.h
@@ -38,7 +38,7 @@  struct rte_trie_tbl {
 	uint32_t	*tbl8_pool;	/**< bitmap containing free tbl8 idxes*/
 	uint32_t	tbl8_pool_pos;
 	/* tbl24 table. */
-	__extension__ alignas(RTE_CACHE_LINE_SIZE) uint64_t	tbl24[0];
+	alignas(RTE_CACHE_LINE_SIZE) uint64_t	tbl24[];
 };
 
 static inline uint32_t