[PATCH] Make if_ether.h compile with CONFIG_SYSCTL=n

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



<linux/if_ether.h> tries to declare a sysctl table even if
CONFIG_SYSCTL is not defined, which breaks the build as below:

      CC      init/main.o
    In file included from /scratch/Ksrc/linux-git/include/linux/netdevice.h:29,
                     from /scratch/Ksrc/linux-git/include/net/sock.h:48,
                     from /scratch/Ksrc/linux-git/init/main.c:50:
    /scratch/Ksrc/linux-git/include/linux/if_ether.h:114: error: array type has incomplete element type

This patch wraps the declaration inside an #ifdef CONFIG_SYSCTL and
fixes my allnoconfig build.

Signed-off-by: Roland Dreier <[email protected]>

diff --git a/include/linux/if_ether.h b/include/linux/if_ether.h
--- a/include/linux/if_ether.h
+++ b/include/linux/if_ether.h
@@ -104,6 +104,7 @@ struct ethhdr {
 } __attribute__((packed));
 
 #ifdef __KERNEL__
+#include <linux/config.h>
 #include <linux/skbuff.h>
 
 static inline struct ethhdr *eth_hdr(const struct sk_buff *skb)
@@ -111,7 +112,9 @@ static inline struct ethhdr *eth_hdr(con
 	return (struct ethhdr *)skb->mac.raw;
 }
 
+#ifdef CONFIG_SYSCTL
 extern struct ctl_table ether_table[];
 #endif
+#endif
 
 #endif	/* _LINUX_IF_ETHER_H */
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]
  Powered by Linux