mlxsw: spectrum_span: Use struct_size() to simplify allocation
authorIdo Schimmel <idosch@mellanox.com>
Thu, 20 Feb 2020 07:07:49 +0000 (09:07 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 20 Feb 2020 18:04:33 +0000 (10:04 -0800)
commit6627b93bf74b56e8a994c9b5972db51a9692a1e4
treef334aebb8e243593f742729b44471a5329760eee
parent9a9f8d1e749a5c4df167bc964277c75b952e32b5
mlxsw: spectrum_span: Use struct_size() to simplify allocation

Allocate the main mirroring struct and the individual structs for the
different mirroring agents in a single allocation.

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c