Skip to content

Commit

Permalink
ipv6: convert the uses of ADBG and remove the superfluous parentheses
Browse files Browse the repository at this point in the history
Just follow the Joe Perches's opinion, it is a better way to fix the
style errors.

Suggested-by: Joe Perches <joe@perches.com>
Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
Cc: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
dingtianhong authored and David S. Miller committed Aug 20, 2013
1 parent dcdc7a5 commit ba3542e
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions net/ipv6/addrconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@
#define ACONF_DEBUG 2

#if ACONF_DEBUG >= 3
#define ADBG(x) printk x
#define ADBG(fmt, ...) printk(fmt, ##__VA_ARGS__)
#else
#define ADBG(x)
#define ADBG(fmt, ...) do { if (0) printk(fmt, ##__VA_ARGS__); } while (0)
#endif

#define INFINITY_LIFE_TIME 0xFFFFFFFF
Expand Down Expand Up @@ -374,19 +374,19 @@ static struct inet6_dev *ipv6_add_dev(struct net_device *dev)
dev_hold(dev);

if (snmp6_alloc_dev(ndev) < 0) {
ADBG((KERN_WARNING
ADBG(KERN_WARNING
"%s: cannot allocate memory for statistics; dev=%s.\n",
__func__, dev->name));
__func__, dev->name);
neigh_parms_release(&nd_tbl, ndev->nd_parms);
dev_put(dev);
kfree(ndev);
return NULL;
}

if (snmp6_register_dev(ndev) < 0) {
ADBG((KERN_WARNING
ADBG(KERN_WARNING
"%s: cannot create /proc/net/dev_snmp6/%s\n",
__func__, dev->name));
__func__, dev->name);
neigh_parms_release(&nd_tbl, ndev->nd_parms);
ndev->dead = 1;
in6_dev_finish_destroy(ndev);
Expand Down Expand Up @@ -849,15 +849,15 @@ 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"));
ADBG("ipv6_add_addr: already assigned\n");
err = -EEXIST;
goto out;
}

ifa = kzalloc(sizeof(struct inet6_ifaddr), GFP_ATOMIC);

if (ifa == NULL) {
ADBG(("ipv6_add_addr: malloc failed\n"));
ADBG("ipv6_add_addr: malloc failed\n");
err = -ENOBUFS;
goto out;
}
Expand Down Expand Up @@ -2057,7 +2057,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"));
ADBG("addrconf: prefix option too short\n");
return;
}

Expand Down Expand Up @@ -3637,8 +3637,8 @@ static void addrconf_verify(unsigned long foo)
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));
ADBG(KERN_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);
Expand Down

0 comments on commit ba3542e

Please sign in to comment.