From: Ido Schimmel Date: Fri, 24 Apr 2020 15:43:45 +0000 (+0300) Subject: mlxsw: spectrum_span: Replace zero-length array with flexible-array member X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=4780dbdbd957c204b62680161f39bb0bc4daf3a0;p=linux.git mlxsw: spectrum_span: Replace zero-length array with flexible-array member In a similar fashion to commit e99f8e7f88b5 ("mlxsw: Replace zero-length array with flexible-array member"), use a flexible-array member to get a compiler warning in case the flexible array does not occur last in the structure. Signed-off-by: Ido Schimmel Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c index 235556be58f5f..ae3c8a1e9a434 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c @@ -22,7 +22,7 @@ struct mlxsw_sp_span { struct mlxsw_sp *mlxsw_sp; atomic_t active_entries_count; int entries_count; - struct mlxsw_sp_span_entry entries[0]; + struct mlxsw_sp_span_entry entries[]; }; static void mlxsw_sp_span_respin_work(struct work_struct *work);