hamradio: bpqether: Fix -Wunused-const-variable warning
authorYueHaibing <yuehaibing@huawei.com>
Tue, 1 Jun 2021 14:00:52 +0000 (22:00 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 2 Jun 2021 00:00:51 +0000 (17:00 -0700)
If CONFIG_PROC_FS is n, gcc warns:

drivers/net/hamradio/bpqether.c:437:36:
 warning: ‘bpq_seqops’ defined but not used [-Wunused-const-variable=]
 static const struct seq_operations bpq_seqops = {
                                    ^~~~~~~~~~
Use #ifdef macro to gurad this.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/hamradio/bpqether.c

index 1ad6085994b1cd74a851c2dca47375d896768553..0e623c2e8b2dcb56f3653ef47ee70fd0389e11db 100644 (file)
@@ -368,7 +368,7 @@ static int bpq_close(struct net_device *dev)
 
 /* ------------------------------------------------------------------------ */
 
-
+#ifdef CONFIG_PROC_FS
 /*
  *     Proc filesystem
  */
@@ -440,7 +440,7 @@ static const struct seq_operations bpq_seqops = {
        .stop = bpq_seq_stop,
        .show = bpq_seq_show,
 };
-
+#endif
 /* ------------------------------------------------------------------------ */
 
 static const struct net_device_ops bpq_netdev_ops = {