All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@kernel.org>
To: Saeed Mahameed <saeedm@nvidia.com>,
	Leon Romanovsky <leon@kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	Tariq Toukan <tariqt@nvidia.com>,
	Moosa Baransi <moosab@nvidia.com>
Cc: Arnd Bergmann <arnd@arndb.de>, Meir Lichtinger <meirl@nvidia.com>,
	Yufeng Mo <moyufeng@huawei.com>,
	netdev@vger.kernel.org, linux-rdma@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH net-next] net/mlx5i: avoid unused function warning for mlx5i_flow_type_mask
Date: Fri, 22 Oct 2021 08:47:03 +0200	[thread overview]
Message-ID: <20211022064710.4158669-1-arnd@kernel.org> (raw)

From: Arnd Bergmann <arnd@arndb.de>

Without CONFIG_MLX5_EN_RXNFC, the function is unused, breaking the
build with CONFIG_WERROR:

mlx5/core/ipoib/ethtool.c:36:12: error: unused function 'mlx5i_flow_type_mask' [-Werror,-Wunused-function]
static u32 mlx5i_flow_type_mask(u32 flow_type)

We could add another #ifdef or mark this function inline, but
replacing the existing #ifdef with a __maybe_unused seems best
because that improves build coverage and avoids introducing
similar problems the next time this code changes.

Fixes: 9fbe1c25ecca ("net/mlx5i: Enable Rx steering for IPoIB via ethtool")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 .../net/ethernet/mellanox/mlx5/core/ipoib/ethtool.c    | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ethtool.c b/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ethtool.c
index ee0eb4a4b819..ae95677a01f0 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ethtool.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ethtool.c
@@ -222,8 +222,8 @@ static int mlx5i_get_link_ksettings(struct net_device *netdev,
 	return 0;
 }
 
-#ifdef CONFIG_MLX5_EN_RXNFC
-static int mlx5i_set_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd)
+static __maybe_unused int mlx5i_set_rxnfc(struct net_device *dev,
+					  struct ethtool_rxnfc *cmd)
 {
 	struct mlx5e_priv *priv = mlx5i_epriv(dev);
 	struct ethtool_rx_flow_spec *fs = &cmd->fs;
@@ -234,14 +234,14 @@ static int mlx5i_set_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd)
 	return mlx5e_ethtool_set_rxnfc(priv, cmd);
 }
 
-static int mlx5i_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *info,
-			   u32 *rule_locs)
+static __maybe_unused int mlx5i_get_rxnfc(struct net_device *dev,
+					  struct ethtool_rxnfc *info,
+					  u32 *rule_locs)
 {
 	struct mlx5e_priv *priv = mlx5i_epriv(dev);
 
 	return mlx5e_ethtool_get_rxnfc(priv, info, rule_locs);
 }
-#endif
 
 const struct ethtool_ops mlx5i_ethtool_ops = {
 	.supported_coalesce_params = ETHTOOL_COALESCE_USECS |
-- 
2.29.2


             reply	other threads:[~2021-10-22  6:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-22  6:47 Arnd Bergmann [this message]
2021-10-25 19:58 ` [PATCH net-next] net/mlx5i: avoid unused function warning for mlx5i_flow_type_mask Saeed Mahameed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211022064710.4158669-1-arnd@kernel.org \
    --to=arnd@kernel.org \
    --cc=arnd@arndb.de \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=leon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=meirl@nvidia.com \
    --cc=moosab@nvidia.com \
    --cc=moyufeng@huawei.com \
    --cc=netdev@vger.kernel.org \
    --cc=saeedm@nvidia.com \
    --cc=tariqt@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.