arp: fix unused variable warnning when CONFIG_PROC_FS=n
authorYajun Deng <yajun.deng@linux.dev>
Fri, 22 Apr 2022 06:14:31 +0000 (14:14 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 25 Apr 2022 10:50:18 +0000 (11:50 +0100)
net/ipv4/arp.c:1412:36: warning: unused variable 'arp_seq_ops' [-Wunused-const-variable]

Add #ifdef CONFIG_PROC_FS for 'arp_seq_ops'.

Fixes: e968b1b3e9b8 ("arp: Remove #ifdef CONFIG_PROC_FS")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Yajun Deng <yajun.deng@linux.dev>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/arp.c

index 2d0c05ca9c6f1bd18d37b510aa1b1a19e9cb1bba..ab4a5601c82af786e207ed625a1835f2f5faccb4 100644 (file)
@@ -1304,9 +1304,9 @@ static struct packet_type arp_packet_type __read_mostly = {
        .func = arp_rcv,
 };
 
+#ifdef CONFIG_PROC_FS
 #if IS_ENABLED(CONFIG_AX25)
 
-/* ------------------------------------------------------------------------ */
 /*
  *     ax25 -> ASCII conversion
  */
@@ -1412,16 +1412,13 @@ static void *arp_seq_start(struct seq_file *seq, loff_t *pos)
        return neigh_seq_start(seq, pos, &arp_tbl, NEIGH_SEQ_SKIP_NOARP);
 }
 
-/* ------------------------------------------------------------------------ */
-
 static const struct seq_operations arp_seq_ops = {
        .start  = arp_seq_start,
        .next   = neigh_seq_next,
        .stop   = neigh_seq_stop,
        .show   = arp_seq_show,
 };
-
-/* ------------------------------------------------------------------------ */
+#endif /* CONFIG_PROC_FS */
 
 static int __net_init arp_net_init(struct net *net)
 {