* [PATCH net-next] cxgb4: Fix -Wunused-const-variable warning
@ 2021-06-01 14:01 YueHaibing
2021-06-02 0:10 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: YueHaibing @ 2021-06-01 14:01 UTC (permalink / raw)
To: rajur, davem, kuba; +Cc: netdev, linux-kernel, YueHaibing
If CONFIG_PCI_IOV is n, make W=1 warns:
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c:3909:33:
warning: ‘cxgb4_mgmt_ethtool_ops’ defined but not used [-Wunused-const-variable=]
static const struct ethtool_ops cxgb4_mgmt_ethtool_ops = {
^~~~~~~~~~~~~~~~~~~~~~
Move it into #ifdef block to fix this.
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
index 421bd9b88028..b730aa1cb141 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
@@ -3894,7 +3894,6 @@ static const struct net_device_ops cxgb4_mgmt_netdev_ops = {
.ndo_set_vf_vlan = cxgb4_mgmt_set_vf_vlan,
.ndo_set_vf_link_state = cxgb4_mgmt_set_vf_link_state,
};
-#endif
static void cxgb4_mgmt_get_drvinfo(struct net_device *dev,
struct ethtool_drvinfo *info)
@@ -3909,6 +3908,7 @@ static void cxgb4_mgmt_get_drvinfo(struct net_device *dev,
static const struct ethtool_ops cxgb4_mgmt_ethtool_ops = {
.get_drvinfo = cxgb4_mgmt_get_drvinfo,
};
+#endif
static void notify_fatal_err(struct work_struct *work)
{
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-next] cxgb4: Fix -Wunused-const-variable warning
2021-06-01 14:01 [PATCH net-next] cxgb4: Fix -Wunused-const-variable warning YueHaibing
@ 2021-06-02 0:10 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-06-02 0:10 UTC (permalink / raw)
To: YueHaibing; +Cc: rajur, davem, kuba, netdev, linux-kernel
Hello:
This patch was applied to netdev/net-next.git (refs/heads/master):
On Tue, 1 Jun 2021 22:01:48 +0800 you wrote:
> If CONFIG_PCI_IOV is n, make W=1 warns:
>
> drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c:3909:33:
> warning: ‘cxgb4_mgmt_ethtool_ops’ defined but not used [-Wunused-const-variable=]
> static const struct ethtool_ops cxgb4_mgmt_ethtool_ops = {
> ^~~~~~~~~~~~~~~~~~~~~~
>
> [...]
Here is the summary with links:
- [net-next] cxgb4: Fix -Wunused-const-variable warning
https://git.kernel.org/netdev/net-next/c/6990c7f44c0d
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-06-02 0:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-01 14:01 [PATCH net-next] cxgb4: Fix -Wunused-const-variable warning YueHaibing
2021-06-02 0:10 ` patchwork-bot+netdevbpf
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.