Skip to contentSkip to conversation

net: netfilter: Remove NFDEBUG.

PATCH Applied Varsha Rao 2 participants 2 messages Aug 25, 2017 – Aug 28, 2017

Subsystems (2)
lore
Share & tools
lore

Varsha Rao

author
#0 lore raw

PATCH 1/1 net: netfilter: Remove NFDEBUG.

Remove NFDEBUG and use pr_debug() instead of it.

---
 net/netfilter/nf_internals.h | 6 ------
 net/netfilter/nf_sockopt.c   | 2 +-
 2 files changed, 1 insertion(+), 7 deletions(-)
net/netfilter/nf_internals.h +0 -6
index 19f00a47a710..e40016742530 100644
@@ -5,12 +5,6 @@
 #include <linux/skbuff.h>
 #include <linux/netdevice.h>
 
-#ifdef CONFIG_NETFILTER_DEBUG
-#define NFDEBUG(format, args...)  printk(KERN_DEBUG format , ## args)
-#else
-#define NFDEBUG(format, args...)
-#endif
-
 /* nf_queue.c */
 int nf_queue(struct sk_buff *skb, struct nf_hook_state *state,
 	     struct nf_hook_entry **entryp, unsigned int verdict);
net/netfilter/nf_sockopt.c +1 -1
index c68c1e58b362..d2a9e6b5d01f 100644
@@ -33,7 +33,7 @@ int nf_register_sockopt(struct nf_sockopt_ops *reg)
 				reg->set_optmin, reg->set_optmax)
 			|| overlap(ops->get_optmin, ops->get_optmax,
 				   reg->get_optmin, reg->get_optmax))) {
-			NFDEBUG("nf_sock overlap: %u-%u/%u-%u v %u-%u/%u-%u\n",
+			pr_debug("nf_sock overlap: %u-%u/%u-%u v %u-%u/%u-%u\n",
 				ops->set_optmin, ops->set_optmax,
 				ops->get_optmin, ops->get_optmax,
 				reg->set_optmin, reg->set_optmax,
Signature · 1 line
2.13.5
maintainer Applied
#1 lore raw
Quoted 1 line · Varsha Rao

Remove NFDEBUG and use pr_debug() instead of it.

Applied, thanks.

Varsha, could you remove CONFIG_NETFILTER_DEBUG too?

Update IP_NF_ASSERT() to use WARN_ON(), this is actually already there in ip6_tables.

net/bridge/netfilter/ebtables.c:#ifdef CONFIG_NETFILTER_DEBUG net/bridge/netfilter/ebtables.c:#ifdef CONFIG_NETFILTER_DEBUG net/bridge/netfilter/ebtables.c:#ifdef CONFIG_NETFILTER_DEBUG net/ipv4/netfilter/ip_tables.c:#ifdef CONFIG_NETFILTER_DEBUG net/ipv6/netfilter/ip6_tables.c:#ifdef CONFIG_NETFILTER_DEBUG

Conversions in ebtables.c are not so straight forward, but still possible to get rid of this.

Make sure Kconfig and defconfig lines also goes away for good.

$ git grep NETFILTER_DEBUG
arch/parisc/configs/c3000_defconfig:CONFIG_NETFILTER_DEBUG=y
arch/sh/configs/se7751_defconfig:CONFIG_NETFILTER_DEBUG=y
include/net/netfilter/nf_conntrack.h:#ifdef CONFIG_NETFILTER_DEBUG
net/Kconfig:config NETFILTER_DEBUG

Same thing for NF_CT_ASSERT(), update it to use WARN_ON() instead.

Actually, you could send two patches: One to update all NF_CT_ASSERT() to use WARN_ON(), then a patch to remove CONFIG_NETFILTER_DEBUG and all these _ASSERT() macros.