]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
mlxsw: core_acl: Avoid defining static variable in header file
authorIdo Schimmel <idosch@mellanox.com>
Fri, 27 Mar 2020 08:55:23 +0000 (11:55 +0300)
committerDavid S. Miller <davem@davemloft.net>
Fri, 27 Mar 2020 22:06:43 +0000 (15:06 -0700)
commite1da9618b785366bed7d175ab6599f897119b87b
tree2b72149ef7d94f450c57d56202d89542c2dbdca1
parentbdb373cf5be0324a734c8d8e93b65a46fd843ced
mlxsw: core_acl: Avoid defining static variable in header file

The static array 'mlxsw_afk_element_infos' in 'core_acl_flex_keys.h' is
copied to each file that includes the header, but not all use it. This
results in the following warnings when compiling with W=1:

drivers/net/ethernet/mellanox/mlxsw//core_acl_flex_keys.h:76:44:
warning: ‘mlxsw_afk_element_infos’ defined but not used
[-Wunused-const-variable=]

One way to suppress the warning is to mark the array with
'__maybe_unused', but another option is to remove it from the header
file entirely.

Change 'struct mlxsw_afk_element_inst' to store the key to the array
('element') instead of the array value keyed by 'element'. Adjust the
different users accordingly.

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/core_acl_flex_keys.c
drivers/net/ethernet/mellanox/mlxsw/core_acl_flex_keys.h