• Ido Schimmel's avatar
    mlxsw: core_acl: Avoid defining static variable in header file · e1da9618
    Ido Schimmel authored
    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: default avatarIdo Schimmel <idosch@mellanox.com>
    Reviewed-by: default avatarJiri Pirko <jiri@mellanox.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    e1da9618
core_acl_flex_keys.c 14.6 KB