OSDN Git Service

mlxsw: item: Annotate item helpers with '__maybe_unused'
authorIdo Schimmel <idosch@nvidia.com>
Fri, 8 Oct 2021 13:23:15 +0000 (16:23 +0300)
committerJakub Kicinski <kuba@kernel.org>
Fri, 8 Oct 2021 23:59:33 +0000 (16:59 -0700)
commitf12e658c620a925aba4caead54a05eb157728863
tree1b4d5e3c2939248e8d390ad25e01d6d4884f9b5f
parente506342a03c777a8d56389ff2764617648562bcf
mlxsw: item: Annotate item helpers with '__maybe_unused'

mlxsw is using helpers to get / set fields in messages exchanged with
the device. It is possible that some fields are only set or only get.
This causes LLVM to emit warnings such as the following when building
with W=1 [1]:

drivers/net/ethernet/mellanox/mlxsw/core_acl_flex_actions.c:2022:1: warning: unused function 'mlxsw_afa_sampler_mirror_agent_get'

The fact that some fields are only set or only get is very much
intentional and not indicative of functions that need to be removed.

Therefore, annotate the item helpers with '__maybe_unused' to suppress
these warnings.

[1] https://lkml.org/lkml/2021/9/29/685

Cc: Nathan Chancellor <nathan@kernel.org>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Link: https://lore.kernel.org/r/20211008132315.90211-1-idosch@idosch.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlxsw/item.h