All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/3 v2] ipv6: rename ADBG() to pr_xxx()
@ 2013-08-13  7:57 Ding Tianhong
  2013-08-13 11:37 ` Hannes Frederic Sowa
  2013-08-13 16:48 ` Joe Perches
  0 siblings, 2 replies; 4+ messages in thread
From: Ding Tianhong @ 2013-08-13  7:57 UTC (permalink / raw)
  To: David S. Miller, Alexey Kuznetsov, James Morris,
	Hideaki YOSHIFUJI, Netdev, Patrick McHardy, Joe Perches

According to Joe Perches opinions, the ADBG() was tedious and it is
better to remove the KERN_<LEVEL>s and use the pr_xxx() instead of ADBG().

Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
Cc: Joe Perches <joe@perches.com>
---
 net/ipv6/addrconf.c | 29 +++++++++--------------------
 1 file changed, 9 insertions(+), 20 deletions(-)

diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 72911fd..2333fa7 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -95,15 +95,6 @@
 #include <linux/seq_file.h>
 #include <linux/export.h>
 
-/* Set to 3 to get tracing... */
-#define ACONF_DEBUG 2
-
-#if ACONF_DEBUG >= 3
-#define ADBG(x) printk x
-#else
-#define ADBG(x)
-#endif
-
 #define	INFINITY_LIFE_TIME	0xFFFFFFFF
 
 static inline u32 cstamp_delta(unsigned long cstamp)
@@ -369,9 +360,8 @@ static struct inet6_dev *ipv6_add_dev(struct net_device *dev)
 	dev_hold(dev);
 
 	if (snmp6_alloc_dev(ndev) < 0) {
-		ADBG((KERN_WARNING
-			"%s: cannot allocate memory for statistics; dev=%s.\n",
-			__func__, dev->name));
+		pr_warning("%s: cannot allocate memory for statistics; dev=%s.\n",
+			__func__, dev->name);
 		neigh_parms_release(&nd_tbl, ndev->nd_parms);
 		dev_put(dev);
 		kfree(ndev);
@@ -379,9 +369,8 @@ static struct inet6_dev *ipv6_add_dev(struct net_device *dev)
 	}
 
 	if (snmp6_register_dev(ndev) < 0) {
-		ADBG((KERN_WARNING
-			"%s: cannot create /proc/net/dev_snmp6/%s\n",
-			__func__, dev->name));
+		pr_warning("%s: cannot create /proc/net/dev_snmp6/%s\n",
+			__func__, dev->name);
 		neigh_parms_release(&nd_tbl, ndev->nd_parms);
 		ndev->dead = 1;
 		in6_dev_finish_destroy(ndev);
@@ -844,7 +833,7 @@ ipv6_add_addr(struct inet6_dev *idev, const struct in6_addr *addr,
 
 	/* Ignore adding duplicate addresses on an interface */
 	if (ipv6_chk_same_addr(dev_net(idev->dev), addr, idev->dev)) {
-		ADBG(("ipv6_add_addr: already assigned\n"));
+		pr_err("ipv6_add_addr: already assigned\n");
 		err = -EEXIST;
 		goto out;
 	}
@@ -852,7 +841,7 @@ ipv6_add_addr(struct inet6_dev *idev, const struct in6_addr *addr,
 	ifa = kzalloc(sizeof(struct inet6_ifaddr), GFP_ATOMIC);
 
 	if (ifa == NULL) {
-		ADBG(("ipv6_add_addr: malloc failed\n"));
+		pr_err("ipv6_add_addr: malloc failed\n");
 		err = -ENOBUFS;
 		goto out;
 	}
@@ -2069,7 +2058,7 @@ void addrconf_prefix_rcv(struct net_device *dev, u8 *opt, int len, bool sllao)
 	pinfo = (struct prefix_info *) opt;
 
 	if (len < sizeof(struct prefix_info)) {
-		ADBG(("addrconf: prefix option too short\n"));
+		pr_err("addrconf: prefix option too short\n");
 		return;
 	}
 
@@ -3649,8 +3638,8 @@ restart:
 	if (time_before(next_sched, jiffies + ADDRCONF_TIMER_FUZZ_MAX))
 		next_sched = jiffies + ADDRCONF_TIMER_FUZZ_MAX;
 
-	ADBG((KERN_DEBUG "now = %lu, schedule = %lu, rounded schedule = %lu => %lu\n",
-	      now, next, next_sec, next_sched));
+	pr_debug("now = %lu, schedule = %lu, rounded schedule = %lu => %lu\n",
+	      now, next, next_sec, next_sched);
 
 	addr_chk_timer.expires = next_sched;
 	add_timer(&addr_chk_timer);
-- 
1.8.2.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/3 v2] ipv6: rename ADBG() to pr_xxx()
  2013-08-13  7:57 [PATCH 2/3 v2] ipv6: rename ADBG() to pr_xxx() Ding Tianhong
@ 2013-08-13 11:37 ` Hannes Frederic Sowa
  2013-08-13 16:48 ` Joe Perches
  1 sibling, 0 replies; 4+ messages in thread
From: Hannes Frederic Sowa @ 2013-08-13 11:37 UTC (permalink / raw)
  To: Ding Tianhong
  Cc: David S. Miller, Alexey Kuznetsov, James Morris,
	Hideaki YOSHIFUJI, Netdev, Patrick McHardy, Joe Perches

On Tue, Aug 13, 2013 at 03:57:28PM +0800, Ding Tianhong wrote:
> According to Joe Perches opinions, the ADBG() was tedious and it is
> better to remove the KERN_<LEVEL>s and use the pr_xxx() instead of ADBG().
> 
> Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
> Cc: Joe Perches <joe@perches.com>
> ---
>  net/ipv6/addrconf.c | 29 +++++++++--------------------
>  1 file changed, 9 insertions(+), 20 deletions(-)
> 
> diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
> index 72911fd..2333fa7 100644
> --- a/net/ipv6/addrconf.c
> +++ b/net/ipv6/addrconf.c
> @@ -95,15 +95,6 @@
>  #include <linux/seq_file.h>
>  #include <linux/export.h>
>  
> -/* Set to 3 to get tracing... */
> -#define ACONF_DEBUG 2
> -
> -#if ACONF_DEBUG >= 3
> -#define ADBG(x) printk x

Please either change this to pr_warning, pr_err.

> -#else
> -#define ADBG(x)
> -#endif
> -
>  #define	INFINITY_LIFE_TIME	0xFFFFFFFF
>  
>  static inline u32 cstamp_delta(unsigned long cstamp)
> @@ -369,9 +360,8 @@ static struct inet6_dev *ipv6_add_dev(struct net_device *dev)
>  	dev_hold(dev);
>  
>  	if (snmp6_alloc_dev(ndev) < 0) {
> -		ADBG((KERN_WARNING
> -			"%s: cannot allocate memory for statistics; dev=%s.\n",
> -			__func__, dev->name));
> +		pr_warning("%s: cannot allocate memory for statistics; dev=%s.\n",
> +			__func__, dev->name);

Or these to pr_debug/pr_dbg (for use with dynamic_debug).

I don't think it gives an advantage to emit debug messages which were designed
solely for debugging purposes before.

I would actually favour the dynamic_debug method.

Greetings,

  Hannes

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/3 v2] ipv6: rename ADBG() to pr_xxx()
  2013-08-13  7:57 [PATCH 2/3 v2] ipv6: rename ADBG() to pr_xxx() Ding Tianhong
  2013-08-13 11:37 ` Hannes Frederic Sowa
@ 2013-08-13 16:48 ` Joe Perches
  2013-08-14  1:43   ` Ding Tianhong
  1 sibling, 1 reply; 4+ messages in thread
From: Joe Perches @ 2013-08-13 16:48 UTC (permalink / raw)
  To: Ding Tianhong
  Cc: David S. Miller, Alexey Kuznetsov, James Morris,
	Hideaki YOSHIFUJI, Netdev, Patrick McHardy

On Tue, 2013-08-13 at 15:57 +0800, Ding Tianhong wrote:
> According to Joe Perches opinions, the ADBG() was tedious and it is
> better to remove the KERN_<LEVEL>s and use the pr_xxx() instead of ADBG().

No, that's not really what I wrote.

I suggested it might be better to remove the KERN_<LEVELS>
from these ADBG uses and use pr_debug.

As is, you've changed logging messages which today
always compile away to nothing to now emit what I
think are pretty unnecessary messages.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/3 v2] ipv6: rename ADBG() to pr_xxx()
  2013-08-13 16:48 ` Joe Perches
@ 2013-08-14  1:43   ` Ding Tianhong
  0 siblings, 0 replies; 4+ messages in thread
From: Ding Tianhong @ 2013-08-14  1:43 UTC (permalink / raw)
  To: Joe Perches
  Cc: David S. Miller, Alexey Kuznetsov, James Morris,
	Hideaki YOSHIFUJI, Netdev, Patrick McHardy

On 2013/8/14 0:48, Joe Perches wrote:
> On Tue, 2013-08-13 at 15:57 +0800, Ding Tianhong wrote:
>> According to Joe Perches opinions, the ADBG() was tedious and it is
>> better to remove the KERN_<LEVEL>s and use the pr_xxx() instead of ADBG().
> 
> No, that's not really what I wrote.
> 
> I suggested it might be better to remove the KERN_<LEVELS>
> from these ADBG uses and use pr_debug.
> 
> As is, you've changed logging messages which today
> always compile away to nothing to now emit what I
> think are pretty unnecessary messages.
> 
> 

sorry for misunderstand your opinion, I will modify it and resend soon.:)

regards
Ding Tianhong

> 
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-08-14  1:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-13  7:57 [PATCH 2/3 v2] ipv6: rename ADBG() to pr_xxx() Ding Tianhong
2013-08-13 11:37 ` Hannes Frederic Sowa
2013-08-13 16:48 ` Joe Perches
2013-08-14  1:43   ` Ding Tianhong

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.