]> git.baikalelectronics.ru Git - kernel.git/commitdiff
mlxsw: spectrum_span: Replace zero-length array with flexible-array member
authorIdo Schimmel <idosch@mellanox.com>
Fri, 24 Apr 2020 15:43:45 +0000 (18:43 +0300)
committerDavid S. Miller <davem@davemloft.net>
Fri, 24 Apr 2020 22:41:51 +0000 (15:41 -0700)
In a similar fashion to commit 6ea014eeabb9 ("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 <idosch@mellanox.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c

index 235556be58f5fc9dc3de4bb14e9f6d67262aa354..ae3c8a1e9a43468193fa427686a2d5547d5d0812 100644 (file)
@@ -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);