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

From: Ido Schimmel
Date: Thu Sep 30 2021 - 02:41:51 EST


On Wed, Sep 29, 2021 at 09:39:41AM -0700, Nathan Chancellor wrote:
> Yes, I would say this is a perfectly fine solution. The warning is there
> to make you consider if you have forgotten to use or remove a function
> depending on the context and if this is expected behavior, silencing the
> compiler with the __maybe_unused attribute is the right thing to do. The
> kernel does this for resume and suspend functions as CONFIG_PM might not
> be set.

Thanks, Nathan. Will send the patch to net-next (most likely next week)
and copy you.