]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: ethernet: ti: cpsw_ale: Remove unused accessor functions
authorSimon Horman <horms@kernel.org>
Thu, 10 Oct 2024 11:04:12 +0000 (12:04 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 14 Oct 2024 12:20:41 +0000 (13:20 +0100)
commit2c9eacbb56de00591e2e4f9484e286c86c3c10b4
treedbc23d5340446a9076c031c2b01dae539189a339
parent4a7b2ba94a59d188e0ab1e5b0ea5a71a23b787fa
net: ethernet: ti: cpsw_ale: Remove unused accessor functions

W=1 builds flag that some accessor functions for ALE fields are unused.

Address this by splitting up the macros used to define these
accessors to allow only those that are used to be declared.

The warnings are verbose, but for example, the mcast_state case is
flagged by clang-18 as:

.../cpsw_ale.c:220:1: warning: unused function 'cpsw_ale_get_mcast_state' [-Wunused-function]
  220 | DEFINE_ALE_FIELD(mcast_state,           62,     2)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.../cpsw_ale.c:145:19: note: expanded from macro 'DEFINE_ALE_FIELD'
  145 | static inline int cpsw_ale_get_##name(u32 *ale_entry)                   \
      |                   ^~~~~~~~~~~~~~~~~~~
<scratch space>:196:1: note: expanded from here
  196 | cpsw_ale_get_mcast_state
      | ^~~~~~~~~~~~~~~~~~~~~~~~

Compile tested only.
No functional change intended.

Signed-off-by: Simon Horman <horms@kernel.org>
Reviewed-by: Roger Quadros <rogerq@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/ti/cpsw_ale.c