[5/7] nfp: replace zero length array with flex array

Message ID 20230113215205.125767-6-stephen@networkplumber.org (mailing list archive)
State Rejected, archived
Delegated to: Thomas Monjalon
Headers
Series replace zero length arrays |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Stephen Hemminger Jan. 13, 2023, 9:52 p.m. UTC
  Zero length arrays are GNU extension. Replace with
standard flex array.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/nfp/flower/nfp_flower_cmsg.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Niklas Söderlund Jan. 15, 2023, 3:22 p.m. UTC | #1
Hi Stephen,

Thanks for your patch.

On 2023-01-13 13:52:03 -0800, Stephen Hemminger wrote:
> Zero length arrays are GNU extension. Replace with
> standard flex array.
> 
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>

I understand this works might depend on another work to raise the 
minimum compiler versions to support this change. Provided this is 
sorted out as part of the full series to move to flex arrays, for the 
change itself.

Acked-by: Niklas Söderlund <niklas.soderlund@corigine.com>

> ---
>  drivers/net/nfp/flower/nfp_flower_cmsg.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/nfp/flower/nfp_flower_cmsg.h b/drivers/net/nfp/flower/nfp_flower_cmsg.h
> index 04601cb0bd25..ee8b439d617f 100644
> --- a/drivers/net/nfp/flower/nfp_flower_cmsg.h
> +++ b/drivers/net/nfp/flower/nfp_flower_cmsg.h
> @@ -73,7 +73,7 @@ struct nfp_flower_cmsg_mac_repr {
>  		uint8_t info;
>  		uint8_t nbi_port;
>  		uint8_t phys_port;
> -	} ports[0];
> +	} ports[];
>  };
>  
>  /*
> -- 
> 2.39.0
>
  

Patch

diff --git a/drivers/net/nfp/flower/nfp_flower_cmsg.h b/drivers/net/nfp/flower/nfp_flower_cmsg.h
index 04601cb0bd25..ee8b439d617f 100644
--- a/drivers/net/nfp/flower/nfp_flower_cmsg.h
+++ b/drivers/net/nfp/flower/nfp_flower_cmsg.h
@@ -73,7 +73,7 @@  struct nfp_flower_cmsg_mac_repr {
 		uint8_t info;
 		uint8_t nbi_port;
 		uint8_t phys_port;
-	} ports[0];
+	} ports[];
 };
 
 /*