* [PATCH net-next 0/4] appletalk: fix checkpatch errors or warning
@ 2014-02-14 7:43 Wang Weidong
2014-02-14 7:43 ` [PATCH net-next 1/4] appletalk: fix checkpatch errors with space required or prohibited Wang Weidong
` (3 more replies)
0 siblings, 4 replies; 11+ messages in thread
From: Wang Weidong @ 2014-02-14 7:43 UTC (permalink / raw)
To: acme, davem; +Cc: netdev
fix checkpatch errors or warning.
Wang Weidong (4):
appletalk: fix checkpatch errors with space required or prohibited
appletalk: fix checkpatch errors with (foo*)|foo * bar
appletalk: convert printks to netdev_<level>
appletalk: fix checkpatch error with indent
net/appletalk/aarp.c | 6 +--
net/appletalk/ddp.c | 109 +++++++++++++++++++++++++--------------------------
2 files changed, 57 insertions(+), 58 deletions(-)
--
1.7.12
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH net-next 1/4] appletalk: fix checkpatch errors with space required or prohibited
2014-02-14 7:43 [PATCH net-next 0/4] appletalk: fix checkpatch errors or warning Wang Weidong
@ 2014-02-14 7:43 ` Wang Weidong
2014-02-14 21:21 ` David Miller
2014-02-14 7:43 ` [PATCH net-next 2/4] appletalk: fix checkpatch errors with foo* bar|foo * bar Wang Weidong
` (2 subsequent siblings)
3 siblings, 1 reply; 11+ messages in thread
From: Wang Weidong @ 2014-02-14 7:43 UTC (permalink / raw)
To: acme, davem; +Cc: netdev
fix checkpatch errors while the space is required or prohibited
Signed-off-by: Wang Weidong <wangweidong1@huawei.com>
---
net/appletalk/aarp.c | 4 ++--
net/appletalk/ddp.c | 6 +++---
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/net/appletalk/aarp.c b/net/appletalk/aarp.c
index d27b86d..d1c55d8 100644
--- a/net/appletalk/aarp.c
+++ b/net/appletalk/aarp.c
@@ -926,7 +926,7 @@ static struct aarp_entry *iter_next(struct aarp_iter_state *iter, loff_t *pos)
struct aarp_entry *entry;
rescan:
- while(ct < AARP_HASH_SIZE) {
+ while (ct < AARP_HASH_SIZE) {
for (entry = table[ct]; entry; entry = entry->next) {
if (!pos || ++off == *pos) {
iter->table = table;
@@ -995,7 +995,7 @@ static const char *dt2str(unsigned long ticks)
{
static char buf[32];
- sprintf(buf, "%ld.%02ld", ticks / HZ, ((ticks % HZ) * 100 ) / HZ);
+ sprintf(buf, "%ld.%02ld", ticks / HZ, ((ticks % HZ) * 100) / HZ);
return buf;
}
diff --git a/net/appletalk/ddp.c b/net/appletalk/ddp.c
index 02806c6..a878df9 100644
--- a/net/appletalk/ddp.c
+++ b/net/appletalk/ddp.c
@@ -936,11 +936,11 @@ static unsigned long atalk_sum_skb(const struct sk_buff *skb, int offset,
int i, copy;
/* checksum stuff in header space */
- if ( (copy = start - offset) > 0) {
+ if ((copy = start - offset) > 0) {
if (copy > len)
copy = len;
sum = atalk_sum_partial(skb->data + offset, copy, sum);
- if ( (len -= copy) == 0)
+ if ((len -= copy) == 0)
return sum;
offset += copy;
@@ -1151,7 +1151,7 @@ static int atalk_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
goto out;
at->src_net = addr->sat_addr.s_net = ap->s_net;
- at->src_node = addr->sat_addr.s_node= ap->s_node;
+ at->src_node = addr->sat_addr.s_node = ap->s_node;
} else {
err = -EADDRNOTAVAIL;
if (!atalk_find_interface(addr->sat_addr.s_net,
--
1.7.12
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH net-next 2/4] appletalk: fix checkpatch errors with foo* bar|foo * bar
2014-02-14 7:43 [PATCH net-next 0/4] appletalk: fix checkpatch errors or warning Wang Weidong
2014-02-14 7:43 ` [PATCH net-next 1/4] appletalk: fix checkpatch errors with space required or prohibited Wang Weidong
@ 2014-02-14 7:43 ` Wang Weidong
2014-02-14 21:21 ` David Miller
2014-02-14 7:43 ` [PATCH net-next 3/4] appletalk: convert printks to pr_<level> Wang Weidong
2014-02-14 7:43 ` [PATCH net-next 4/4] appletalk: fix checkpatch error with indent Wang Weidong
3 siblings, 1 reply; 11+ messages in thread
From: Wang Weidong @ 2014-02-14 7:43 UTC (permalink / raw)
To: acme, davem; +Cc: netdev
fix checkpatch errors below:
ERROR: "foo* bar" should be "foo *bar"
ERROR: "foo * bar" should be "foo *bar"
Signed-off-by: Wang Weidong <wangweidong1@huawei.com>
---
net/appletalk/ddp.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/appletalk/ddp.c b/net/appletalk/ddp.c
index a878df9..06e0d19 100644
--- a/net/appletalk/ddp.c
+++ b/net/appletalk/ddp.c
@@ -293,7 +293,7 @@ static int atif_probe_device(struct atalk_iface *atif)
/* Perform AARP probing for a proxy address */
static int atif_proxy_probe_device(struct atalk_iface *atif,
- struct atalk_addr* proxy_addr)
+ struct atalk_addr *proxy_addr)
{
int netrange = ntohs(atif->nets.nr_lastnet) -
ntohs(atif->nets.nr_firstnet) + 1;
@@ -581,7 +581,7 @@ out:
}
/* Delete a route. Find it and discard it */
-static int atrtr_delete(struct atalk_addr * addr)
+static int atrtr_delete(struct atalk_addr *addr)
{
struct atalk_route **r = &atalk_routes;
int retval = 0;
--
1.7.12
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH net-next 3/4] appletalk: convert printks to pr_<level>
2014-02-14 7:43 [PATCH net-next 0/4] appletalk: fix checkpatch errors or warning Wang Weidong
2014-02-14 7:43 ` [PATCH net-next 1/4] appletalk: fix checkpatch errors with space required or prohibited Wang Weidong
2014-02-14 7:43 ` [PATCH net-next 2/4] appletalk: fix checkpatch errors with foo* bar|foo * bar Wang Weidong
@ 2014-02-14 7:43 ` Wang Weidong
2014-02-14 21:21 ` David Miller
2014-02-14 21:45 ` Sergei Shtylyov
2014-02-14 7:43 ` [PATCH net-next 4/4] appletalk: fix checkpatch error with indent Wang Weidong
3 siblings, 2 replies; 11+ messages in thread
From: Wang Weidong @ 2014-02-14 7:43 UTC (permalink / raw)
To: acme, davem; +Cc: netdev
Prefer pr_<level> then printk(LEVEL).
Signed-off-by: Wang Weidong <wangweidong1@huawei.com>
---
net/appletalk/aarp.c | 2 +-
net/appletalk/ddp.c | 13 ++++++-------
2 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/net/appletalk/aarp.c b/net/appletalk/aarp.c
index d1c55d8..9ec36ed 100644
--- a/net/appletalk/aarp.c
+++ b/net/appletalk/aarp.c
@@ -883,7 +883,7 @@ void __init aarp_proto_init(void)
{
aarp_dl = register_snap_client(aarp_snap_id, aarp_rcv);
if (!aarp_dl)
- printk(KERN_CRIT "Unable to register AARP with SNAP.\n");
+ pr_crit("Unable to register AARP with SNAP.\n");
setup_timer(&aarp_timer, aarp_expire_timeout, 0);
aarp_timer.expires = jiffies + sysctl_aarp_expiry_time;
add_timer(&aarp_timer);
diff --git a/net/appletalk/ddp.c b/net/appletalk/ddp.c
index 06e0d19..9189d3c 100644
--- a/net/appletalk/ddp.c
+++ b/net/appletalk/ddp.c
@@ -704,9 +704,9 @@ static int atif_ioctl(int cmd, void __user *arg)
if ((dev->flags & IFF_POINTOPOINT) &&
atalk_find_interface(sa->sat_addr.s_net,
sa->sat_addr.s_node)) {
- printk(KERN_DEBUG "AppleTalk: point-to-point "
- "interface added with "
- "existing address\n");
+ pr_debug("AppleTalk: point-to-point "
+ "interface added with "
+ "existing address\n");
add_route = 0;
}
@@ -768,8 +768,7 @@ static int atif_ioctl(int cmd, void __user *arg)
} else {
limit = ntohs(nr->nr_lastnet);
if (limit - ntohs(nr->nr_firstnet) > 4096) {
- printk(KERN_WARNING "Too many routes/"
- "iface.\n");
+ pr_warn("Too many routes/iface.\n");
return -EINVAL;
}
if (add_route)
@@ -1329,8 +1328,8 @@ static int atalk_route_packet(struct sk_buff *skb, struct net_device *dev,
* needs to be broadcast onto the default network?
*/
if (dev->type == ARPHRD_PPP)
- printk(KERN_DEBUG "AppleTalk: didn't forward broadcast "
- "packet received from PPP iface\n");
+ pr_debug("AppleTalk: didn't forward broadcast "
+ "packet received from PPP iface\n");
goto free_it;
}
--
1.7.12
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH net-next 4/4] appletalk: fix checkpatch error with indent
2014-02-14 7:43 [PATCH net-next 0/4] appletalk: fix checkpatch errors or warning Wang Weidong
` (2 preceding siblings ...)
2014-02-14 7:43 ` [PATCH net-next 3/4] appletalk: convert printks to pr_<level> Wang Weidong
@ 2014-02-14 7:43 ` Wang Weidong
2014-02-14 21:21 ` David Miller
3 siblings, 1 reply; 11+ messages in thread
From: Wang Weidong @ 2014-02-14 7:43 UTC (permalink / raw)
To: acme, davem; +Cc: netdev
checkpatch error: switch and case should be at the same indent.
Signed-off-by: Wang Weidong <wangweidong1@huawei.com>
---
net/appletalk/ddp.c | 90 ++++++++++++++++++++++++++---------------------------
1 file changed, 45 insertions(+), 45 deletions(-)
diff --git a/net/appletalk/ddp.c b/net/appletalk/ddp.c
index 786255c..5fd5122 100644
--- a/net/appletalk/ddp.c
+++ b/net/appletalk/ddp.c
@@ -1789,53 +1789,53 @@ static int atalk_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
void __user *argp = (void __user *)arg;
switch (cmd) {
- /* Protocol layer */
- case TIOCOUTQ: {
- long amount = sk->sk_sndbuf - sk_wmem_alloc_get(sk);
+ /* Protocol layer */
+ case TIOCOUTQ: {
+ long amount = sk->sk_sndbuf - sk_wmem_alloc_get(sk);
- if (amount < 0)
- amount = 0;
- rc = put_user(amount, (int __user *)argp);
- break;
- }
- case TIOCINQ: {
- /*
- * These two are safe on a single CPU system as only
- * user tasks fiddle here
- */
- struct sk_buff *skb = skb_peek(&sk->sk_receive_queue);
- long amount = 0;
+ if (amount < 0)
+ amount = 0;
+ rc = put_user(amount, (int __user *)argp);
+ break;
+ }
+ case TIOCINQ: {
+ /*
+ * These two are safe on a single CPU system as only
+ * user tasks fiddle here
+ */
+ struct sk_buff *skb = skb_peek(&sk->sk_receive_queue);
+ long amount = 0;
- if (skb)
- amount = skb->len - sizeof(struct ddpehdr);
- rc = put_user(amount, (int __user *)argp);
- break;
- }
- case SIOCGSTAMP:
- rc = sock_get_timestamp(sk, argp);
- break;
- case SIOCGSTAMPNS:
- rc = sock_get_timestampns(sk, argp);
- break;
- /* Routing */
- case SIOCADDRT:
- case SIOCDELRT:
- rc = -EPERM;
- if (capable(CAP_NET_ADMIN))
- rc = atrtr_ioctl(cmd, argp);
- break;
- /* Interface */
- case SIOCGIFADDR:
- case SIOCSIFADDR:
- case SIOCGIFBRDADDR:
- case SIOCATALKDIFADDR:
- case SIOCDIFADDR:
- case SIOCSARP: /* proxy AARP */
- case SIOCDARP: /* proxy AARP */
- rtnl_lock();
- rc = atif_ioctl(cmd, argp);
- rtnl_unlock();
- break;
+ if (skb)
+ amount = skb->len - sizeof(struct ddpehdr);
+ rc = put_user(amount, (int __user *)argp);
+ break;
+ }
+ case SIOCGSTAMP:
+ rc = sock_get_timestamp(sk, argp);
+ break;
+ case SIOCGSTAMPNS:
+ rc = sock_get_timestampns(sk, argp);
+ break;
+ /* Routing */
+ case SIOCADDRT:
+ case SIOCDELRT:
+ rc = -EPERM;
+ if (capable(CAP_NET_ADMIN))
+ rc = atrtr_ioctl(cmd, argp);
+ break;
+ /* Interface */
+ case SIOCGIFADDR:
+ case SIOCSIFADDR:
+ case SIOCGIFBRDADDR:
+ case SIOCATALKDIFADDR:
+ case SIOCDIFADDR:
+ case SIOCSARP: /* proxy AARP */
+ case SIOCDARP: /* proxy AARP */
+ rtnl_lock();
+ rc = atif_ioctl(cmd, argp);
+ rtnl_unlock();
+ break;
}
return rc;
--
1.7.12
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH net-next 1/4] appletalk: fix checkpatch errors with space required or prohibited
2014-02-14 7:43 ` [PATCH net-next 1/4] appletalk: fix checkpatch errors with space required or prohibited Wang Weidong
@ 2014-02-14 21:21 ` David Miller
0 siblings, 0 replies; 11+ messages in thread
From: David Miller @ 2014-02-14 21:21 UTC (permalink / raw)
To: wangweidong1; +Cc: acme, netdev
From: Wang Weidong <wangweidong1@huawei.com>
Date: Fri, 14 Feb 2014 15:43:43 +0800
> fix checkpatch errors while the space is required or prohibited
>
> Signed-off-by: Wang Weidong <wangweidong1@huawei.com>
Applied.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH net-next 2/4] appletalk: fix checkpatch errors with foo* bar|foo * bar
2014-02-14 7:43 ` [PATCH net-next 2/4] appletalk: fix checkpatch errors with foo* bar|foo * bar Wang Weidong
@ 2014-02-14 21:21 ` David Miller
0 siblings, 0 replies; 11+ messages in thread
From: David Miller @ 2014-02-14 21:21 UTC (permalink / raw)
To: wangweidong1; +Cc: acme, netdev
From: Wang Weidong <wangweidong1@huawei.com>
Date: Fri, 14 Feb 2014 15:43:44 +0800
> fix checkpatch errors below:
> ERROR: "foo* bar" should be "foo *bar"
> ERROR: "foo * bar" should be "foo *bar"
>
> Signed-off-by: Wang Weidong <wangweidong1@huawei.com>
Applied.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH net-next 3/4] appletalk: convert printks to pr_<level>
2014-02-14 7:43 ` [PATCH net-next 3/4] appletalk: convert printks to pr_<level> Wang Weidong
@ 2014-02-14 21:21 ` David Miller
2014-02-14 21:45 ` Sergei Shtylyov
1 sibling, 0 replies; 11+ messages in thread
From: David Miller @ 2014-02-14 21:21 UTC (permalink / raw)
To: wangweidong1; +Cc: acme, netdev
From: Wang Weidong <wangweidong1@huawei.com>
Date: Fri, 14 Feb 2014 15:43:45 +0800
> Prefer pr_<level> then printk(LEVEL).
>
> Signed-off-by: Wang Weidong <wangweidong1@huawei.com>
Not applied, please sort out the pr_debug() vs. printk(KERN_DEBUG
differences pointed out to you.
Thanks.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH net-next 4/4] appletalk: fix checkpatch error with indent
2014-02-14 7:43 ` [PATCH net-next 4/4] appletalk: fix checkpatch error with indent Wang Weidong
@ 2014-02-14 21:21 ` David Miller
0 siblings, 0 replies; 11+ messages in thread
From: David Miller @ 2014-02-14 21:21 UTC (permalink / raw)
To: wangweidong1; +Cc: acme, netdev
From: Wang Weidong <wangweidong1@huawei.com>
Date: Fri, 14 Feb 2014 15:43:46 +0800
> checkpatch error: switch and case should be at the same indent.
>
> Signed-off-by: Wang Weidong <wangweidong1@huawei.com>
Applied.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH net-next 3/4] appletalk: convert printks to pr_<level>
2014-02-14 7:43 ` [PATCH net-next 3/4] appletalk: convert printks to pr_<level> Wang Weidong
2014-02-14 21:21 ` David Miller
@ 2014-02-14 21:45 ` Sergei Shtylyov
2014-02-15 1:19 ` Wang Weidong
1 sibling, 1 reply; 11+ messages in thread
From: Sergei Shtylyov @ 2014-02-14 21:45 UTC (permalink / raw)
To: Wang Weidong, acme, davem; +Cc: netdev
Hello.
On 02/14/2014 10:43 AM, Wang Weidong wrote:
> Prefer pr_<level> then printk(LEVEL).
> Signed-off-by: Wang Weidong <wangweidong1@huawei.com>
[...]
> diff --git a/net/appletalk/ddp.c b/net/appletalk/ddp.c
> index 06e0d19..9189d3c 100644
> --- a/net/appletalk/ddp.c
> +++ b/net/appletalk/ddp.c
> @@ -704,9 +704,9 @@ static int atif_ioctl(int cmd, void __user *arg)
> if ((dev->flags & IFF_POINTOPOINT) &&
> atalk_find_interface(sa->sat_addr.s_net,
> sa->sat_addr.s_node)) {
> - printk(KERN_DEBUG "AppleTalk: point-to-point "
> - "interface added with "
> - "existing address\n");
> + pr_debug("AppleTalk: point-to-point "
> + "interface added with "
> + "existing address\n");
> add_route = 0;
> }
>
[...]
> @@ -1329,8 +1328,8 @@ static int atalk_route_packet(struct sk_buff *skb, struct net_device *dev,
> * needs to be broadcast onto the default network?
> */
> if (dev->type == ARPHRD_PPP)
> - printk(KERN_DEBUG "AppleTalk: didn't forward broadcast "
> - "packet received from PPP iface\n");
> + pr_debug("AppleTalk: didn't forward broadcast "
> + "packet received from PPP iface\n");
pr_debug() is not equivalent to printk(KERN_DEBUG). It will only print a
message if DEBUG is defined or if dynamic debugging is enabled.
WBR, Sergei
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH net-next 3/4] appletalk: convert printks to pr_<level>
2014-02-14 21:45 ` Sergei Shtylyov
@ 2014-02-15 1:19 ` Wang Weidong
0 siblings, 0 replies; 11+ messages in thread
From: Wang Weidong @ 2014-02-15 1:19 UTC (permalink / raw)
To: Sergei Shtylyov, acme, davem; +Cc: netdev
On 2014/2/15 5:45, Sergei Shtylyov wrote:
> Hello.
>
> On 02/14/2014 10:43 AM, Wang Weidong wrote:
>
>> Prefer pr_<level> then printk(LEVEL).
>
>> Signed-off-by: Wang Weidong <wangweidong1@huawei.com>
>
> [...]
>> diff --git a/net/appletalk/ddp.c b/net/appletalk/ddp.c
>> index 06e0d19..9189d3c 100644
>> --- a/net/appletalk/ddp.c
>> +++ b/net/appletalk/ddp.c
>> @@ -704,9 +704,9 @@ static int atif_ioctl(int cmd, void __user *arg)
>> if ((dev->flags & IFF_POINTOPOINT) &&
>> atalk_find_interface(sa->sat_addr.s_net,
>> sa->sat_addr.s_node)) {
>> - printk(KERN_DEBUG "AppleTalk: point-to-point "
>> - "interface added with "
>> - "existing address\n");
>> + pr_debug("AppleTalk: point-to-point "
>> + "interface added with "
>> + "existing address\n");
>> add_route = 0;
>> }
>>
> [...]
>> @@ -1329,8 +1328,8 @@ static int atalk_route_packet(struct sk_buff *skb, struct net_device *dev,
>> * needs to be broadcast onto the default network?
>> */
>> if (dev->type == ARPHRD_PPP)
>> - printk(KERN_DEBUG "AppleTalk: didn't forward broadcast "
>> - "packet received from PPP iface\n");
>> + pr_debug("AppleTalk: didn't forward broadcast "
>> + "packet received from PPP iface\n");
>
> pr_debug() is not equivalent to printk(KERN_DEBUG). It will only print a message if DEBUG is defined or if dynamic debugging is enabled.
>
Got it.
WBR, Wang
> WBR, Sergei
>
>
>
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2014-02-15 1:19 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-14 7:43 [PATCH net-next 0/4] appletalk: fix checkpatch errors or warning Wang Weidong
2014-02-14 7:43 ` [PATCH net-next 1/4] appletalk: fix checkpatch errors with space required or prohibited Wang Weidong
2014-02-14 21:21 ` David Miller
2014-02-14 7:43 ` [PATCH net-next 2/4] appletalk: fix checkpatch errors with foo* bar|foo * bar Wang Weidong
2014-02-14 21:21 ` David Miller
2014-02-14 7:43 ` [PATCH net-next 3/4] appletalk: convert printks to pr_<level> Wang Weidong
2014-02-14 21:21 ` David Miller
2014-02-14 21:45 ` Sergei Shtylyov
2014-02-15 1:19 ` Wang Weidong
2014-02-14 7:43 ` [PATCH net-next 4/4] appletalk: fix checkpatch error with indent Wang Weidong
2014-02-14 21:21 ` David Miller
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.