* [PATCH net-next v2 0/3] ipv6: fix checkpatch errors and warnings.
@ 2014-03-28 4:07 Wangyufen
2014-03-28 4:07 ` [PATCH net-next v2 1/3] ipv6: fix checkpatch errors comments and space Wangyufen
` (3 more replies)
0 siblings, 4 replies; 15+ messages in thread
From: Wangyufen @ 2014-03-28 4:07 UTC (permalink / raw)
To: davem, netdev; +Cc: Wang Yufen
From: Wang Yufen <wangyufen@huawei.com>
Wang Yufen (3):
ipv6: fix checkpatch errors comments and space
ipv6: fix checkpatch errors of brace and trailing statements
ipv6: fix checkpatch errors of foo
v2: Reindent the lines as suggested by Sergei Shtylyov.
net/ipv6/ip6_fib.c | 74 +++---
1 file changed, 37 insertions(+), 37 deletions(-)
--
1.7.12
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH net-next v2 1/3] ipv6: fix checkpatch errors comments and space
2014-03-28 4:07 [PATCH net-next v2 0/3] ipv6: fix checkpatch errors and warnings Wangyufen
@ 2014-03-28 4:07 ` Wangyufen
2014-03-28 4:07 ` [PATCH net-next v2 2/3] ipv6: fix checkpatch errors of brace and trailing statements Wangyufen
` (2 subsequent siblings)
3 siblings, 0 replies; 15+ messages in thread
From: Wangyufen @ 2014-03-28 4:07 UTC (permalink / raw)
To: davem, netdev; +Cc: Wang Yufen
From: Wang Yufen <wangyufen@huawei.com>
WARNING: please, no space before tabs
WARNING: please, no spaces at the start of a line
ERROR: spaces required around that ':' (ctx:VxW)
ERROR: spaces required around that '>' (ctx:VxV)
ERROR: spaces required around that '>=' (ctx:VxV)
Signed-off-by: Wang Yufen <wangyufen@huawei.com>
---
net/ipv6/ip6_fib.c | 26 ++++++++++++--------------
1 file changed, 12 insertions(+), 14 deletions(-)
diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
index 075602f..c626a0f 100644
--- a/net/ipv6/ip6_fib.c
+++ b/net/ipv6/ip6_fib.c
@@ -9,14 +9,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
- */
-
-/*
- * Changes:
- * Yuji SEKIYA @USAGI: Support default route on router node;
- * remove ip6_null_entry from the top of
- * routing table.
- * Ville Nuorvala: Fixed routing subtrees.
+ *
+ * Changes:
+ * Yuji SEKIYA @USAGI: Support default route on router node;
+ * remove ip6_null_entry from the top of
+ * routing table.
+ * Ville Nuorvala: Fixed routing subtrees.
*/
#define pr_fmt(fmt) "IPv6: " fmt
@@ -138,7 +136,7 @@ static __inline__ __be32 addr_bit_set(const void *token, int fn_bit)
const __be32 *addr = token;
/*
* Here,
- * 1 << ((~fn_bit ^ BITOP_BE32_SWIZZLE) & 0x1f)
+ * 1 << ((~fn_bit ^ BITOP_BE32_SWIZZLE) & 0x1f)
* is optimized version of
* htonl(1 << ((~fn_bit)&0x1F))
* See include/asm-generic/bitops/le.h.
@@ -485,7 +483,7 @@ static struct fib6_node *fib6_add_1(struct fib6_node *root,
fn->fn_sernum = sernum;
dir = addr_bit_set(addr, fn->fn_bit);
pn = fn;
- fn = dir ? fn->right: fn->left;
+ fn = dir ? fn->right : fn->left;
} while (fn);
if (!allow_create) {
@@ -1213,10 +1211,10 @@ static struct fib6_node *fib6_repair_tree(struct net *net,
w->node = child;
if (children&2) {
RT6_TRACE("W %p adjusted by delnode 2, s=%d\n", w, w->state);
- w->state = w->state>=FWS_R ? FWS_U : FWS_INIT;
+ w->state = w->state >= FWS_R ? FWS_U : FWS_INIT;
} else {
RT6_TRACE("W %p adjusted by delnode 2, s=%d\n", w, w->state);
- w->state = w->state>=FWS_C ? FWS_U : FWS_INIT;
+ w->state = w->state >= FWS_C ? FWS_U : FWS_INIT;
}
}
}
@@ -1314,7 +1312,7 @@ int fib6_del(struct rt6_info *rt, struct nl_info *info)
struct rt6_info **rtp;
#if RT6_DEBUG >= 2
- if (rt->dst.obsolete>0) {
+ if (rt->dst.obsolete > 0) {
WARN_ON(fn != NULL);
return -ENOENT;
}
@@ -1707,7 +1705,7 @@ out_rt6_stats:
kfree(net->ipv6.rt6_stats);
out_timer:
return -ENOMEM;
- }
+}
static void fib6_net_exit(struct net *net)
{
--
1.7.12
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH net-next v2 2/3] ipv6: fix checkpatch errors of brace and trailing statements
2014-03-28 4:07 [PATCH net-next v2 0/3] ipv6: fix checkpatch errors and warnings Wangyufen
2014-03-28 4:07 ` [PATCH net-next v2 1/3] ipv6: fix checkpatch errors comments and space Wangyufen
@ 2014-03-28 4:07 ` Wangyufen
2014-03-28 4:07 ` [PATCH net-next v2 3/3] ipv6: fix checkpatch errors of "foo*" and "foo * bar" Wangyufen
2014-03-29 22:16 ` [PATCH net-next v2 0/3] ipv6: fix checkpatch errors and warnings David Miller
3 siblings, 0 replies; 15+ messages in thread
From: Wangyufen @ 2014-03-28 4:07 UTC (permalink / raw)
To: davem, netdev; +Cc: Wang Yufen
From: Wang Yufen <wangyufen@huawei.com>
ERROR: open brace '{' following enum go on the same line
ERROR: open brace '{' following struct go on the same line
ERROR: trailing statements should be on next line
Signed-off-by: Wang Yufen <wangyufen@huawei.com>
---
net/ipv6/ip6_fib.c | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
index c626a0f..8cb6949 100644
--- a/net/ipv6/ip6_fib.c
+++ b/net/ipv6/ip6_fib.c
@@ -46,8 +46,7 @@
static struct kmem_cache * fib6_node_kmem __read_mostly;
-enum fib_walk_state_t
-{
+enum fib_walk_state_t {
#ifdef CONFIG_IPV6_SUBTREES
FWS_S,
#endif
@@ -57,8 +56,7 @@ enum fib_walk_state_t
FWS_U
};
-struct fib6_cleaner_t
-{
+struct fib6_cleaner_t {
struct fib6_walker_t w;
struct net *net;
int (*func)(struct rt6_info *, void *arg);
@@ -1149,8 +1147,10 @@ static struct fib6_node *fib6_repair_tree(struct net *net,
children = 0;
child = NULL;
- if (fn->right) child = fn->right, children |= 1;
- if (fn->left) child = fn->left, children |= 2;
+ if (fn->right)
+ child = fn->right, children |= 1;
+ if (fn->left)
+ child = fn->left, children |= 2;
if (children == 3 || FIB6_SUBTREE(fn)
#ifdef CONFIG_IPV6_SUBTREES
@@ -1178,8 +1178,10 @@ static struct fib6_node *fib6_repair_tree(struct net *net,
} else {
WARN_ON(fn->fn_flags & RTN_ROOT);
#endif
- if (pn->right == fn) pn->right = child;
- else if (pn->left == fn) pn->left = child;
+ if (pn->right == fn)
+ pn->right = child;
+ else if (pn->left == fn)
+ pn->left = child;
#if RT6_DEBUG >= 2
else
WARN_ON(1);
--
1.7.12
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH net-next v2 3/3] ipv6: fix checkpatch errors of "foo*" and "foo * bar"
2014-03-28 4:07 [PATCH net-next v2 0/3] ipv6: fix checkpatch errors and warnings Wangyufen
2014-03-28 4:07 ` [PATCH net-next v2 1/3] ipv6: fix checkpatch errors comments and space Wangyufen
2014-03-28 4:07 ` [PATCH net-next v2 2/3] ipv6: fix checkpatch errors of brace and trailing statements Wangyufen
@ 2014-03-28 4:07 ` Wangyufen
2014-03-28 4:22 ` Joe Perches
2014-03-28 13:30 ` Sergei Shtylyov
2014-03-29 22:16 ` [PATCH net-next v2 0/3] ipv6: fix checkpatch errors and warnings David Miller
3 siblings, 2 replies; 15+ messages in thread
From: Wangyufen @ 2014-03-28 4:07 UTC (permalink / raw)
To: davem, netdev; +Cc: Wang Yufen
From: Wang Yufen <wangyufen@huawei.com>
ERROR: "(foo*)" should be "(foo *)"
ERROR: "foo * bar" should be "foo *bar"
Suggested-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Wang Yufen <wangyufen@huawei.com>
---
net/ipv6/ip6_fib.c | 30 +++++++++++++++---------------
1 file changed, 15 insertions(+), 15 deletions(-)
diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
index 8cb6949..aafc5bd 100644
--- a/net/ipv6/ip6_fib.c
+++ b/net/ipv6/ip6_fib.c
@@ -44,7 +44,7 @@
#define RT6_TRACE(x...) do { ; } while (0)
#endif
-static struct kmem_cache * fib6_node_kmem __read_mostly;
+static struct kmem_cache *fib6_node_kmem __read_mostly;
enum fib_walk_state_t {
#ifdef CONFIG_IPV6_SUBTREES
@@ -143,7 +143,7 @@ static __inline__ __be32 addr_bit_set(const void *token, int fn_bit)
addr[fn_bit >> 5];
}
-static __inline__ struct fib6_node * node_alloc(void)
+static __inline__ struct fib6_node *node_alloc(void)
{
struct fib6_node *fn;
@@ -152,7 +152,7 @@ static __inline__ struct fib6_node * node_alloc(void)
return fn;
}
-static __inline__ void node_free(struct fib6_node * fn)
+static __inline__ void node_free(struct fib6_node *fn)
{
kmem_cache_free(fib6_node_kmem, fn);
}
@@ -288,7 +288,7 @@ static int fib6_dump_node(struct fib6_walker_t *w)
static void fib6_dump_end(struct netlink_callback *cb)
{
- struct fib6_walker_t *w = (void*)cb->args[2];
+ struct fib6_walker_t *w = (void *)cb->args[2];
if (w) {
if (cb->args[4]) {
@@ -298,7 +298,7 @@ static void fib6_dump_end(struct netlink_callback *cb)
cb->args[2] = 0;
kfree(w);
}
- cb->done = (void*)cb->args[3];
+ cb->done = (void *)cb->args[3];
cb->args[1] = 3;
}
@@ -951,8 +951,8 @@ struct lookup_args {
const struct in6_addr *addr; /* search key */
};
-static struct fib6_node * fib6_lookup_1(struct fib6_node *root,
- struct lookup_args *args)
+static struct fib6_node *fib6_lookup_1(struct fib6_node *root,
+ struct lookup_args *args)
{
struct fib6_node *fn;
__be32 dir;
@@ -1014,8 +1014,8 @@ backtrack:
return NULL;
}
-struct fib6_node * fib6_lookup(struct fib6_node *root, const struct in6_addr *daddr,
- const struct in6_addr *saddr)
+struct fib6_node *fib6_lookup(struct fib6_node *root, const struct in6_addr *daddr,
+ const struct in6_addr *saddr)
{
struct fib6_node *fn;
struct lookup_args args[] = {
@@ -1047,9 +1047,9 @@ struct fib6_node * fib6_lookup(struct fib6_node *root, const struct in6_addr *da
*/
-static struct fib6_node * fib6_locate_1(struct fib6_node *root,
- const struct in6_addr *addr,
- int plen, int offset)
+static struct fib6_node *fib6_locate_1(struct fib6_node *root,
+ const struct in6_addr *addr,
+ int plen, int offset)
{
struct fib6_node *fn;
@@ -1077,9 +1077,9 @@ static struct fib6_node * fib6_locate_1(struct fib6_node *root,
return NULL;
}
-struct fib6_node * fib6_locate(struct fib6_node *root,
- const struct in6_addr *daddr, int dst_len,
- const struct in6_addr *saddr, int src_len)
+struct fib6_node *fib6_locate(struct fib6_node *root,
+ const struct in6_addr *daddr, int dst_len,
+ const struct in6_addr *saddr, int src_len)
{
struct fib6_node *fn;
--
1.7.12
^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH net-next v2 3/3] ipv6: fix checkpatch errors of "foo*" and "foo * bar"
2014-03-28 4:07 ` [PATCH net-next v2 3/3] ipv6: fix checkpatch errors of "foo*" and "foo * bar" Wangyufen
@ 2014-03-28 4:22 ` Joe Perches
2014-03-28 5:40 ` David Miller
2014-03-28 13:30 ` Sergei Shtylyov
1 sibling, 1 reply; 15+ messages in thread
From: Joe Perches @ 2014-03-28 4:22 UTC (permalink / raw)
To: Wangyufen; +Cc: davem, netdev
On Fri, 2014-03-28 at 12:07 +0800, Wangyufen wrote:
[]
> diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
[]
> @@ -143,7 +143,7 @@ static __inline__ __be32 addr_bit_set(const void *token, int fn_bit)
> addr[fn_bit >> 5];
> }
Perhaps all the __inline__ uses could be changed to inline too.
> -static __inline__ struct fib6_node * node_alloc(void)
> +static __inline__ struct fib6_node *node_alloc(void)
> {
> struct fib6_node *fn;
>
> @@ -152,7 +152,7 @@ static __inline__ struct fib6_node * node_alloc(void)
> return fn;
> }
>
> -static __inline__ void node_free(struct fib6_node * fn)
> +static __inline__ void node_free(struct fib6_node *fn)
> {
> kmem_cache_free(fib6_node_kmem, fn);
> }
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH net-next v2 3/3] ipv6: fix checkpatch errors of "foo*" and "foo * bar"
2014-03-28 4:22 ` Joe Perches
@ 2014-03-28 5:40 ` David Miller
2014-03-28 5:47 ` Joe Perches
2014-03-28 10:17 ` Hannes Frederic Sowa
0 siblings, 2 replies; 15+ messages in thread
From: David Miller @ 2014-03-28 5:40 UTC (permalink / raw)
To: joe; +Cc: wangyufen, netdev
From: Joe Perches <joe@perches.com>
Date: Thu, 27 Mar 2014 21:22:01 -0700
> On Fri, 2014-03-28 at 12:07 +0800, Wangyufen wrote:
> []
>> diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
> []
>> @@ -143,7 +143,7 @@ static __inline__ __be32 addr_bit_set(const void *token, int fn_bit)
>> addr[fn_bit >> 5];
>> }
>
> Perhaps all the __inline__ uses could be changed to inline too.
Or rather, deleted completely, this is a *.c file after all.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH net-next v2 3/3] ipv6: fix checkpatch errors of "foo*" and "foo * bar"
2014-03-28 5:40 ` David Miller
@ 2014-03-28 5:47 ` Joe Perches
2014-03-28 9:33 ` wangyufen
2014-03-28 10:17 ` Hannes Frederic Sowa
1 sibling, 1 reply; 15+ messages in thread
From: Joe Perches @ 2014-03-28 5:47 UTC (permalink / raw)
To: David Miller; +Cc: wangyufen, netdev
On Fri, 2014-03-28 at 01:40 -0400, David Miller wrote:
> From: Joe Perches <joe@perches.com>
> Date: Thu, 27 Mar 2014 21:22:01 -0700
>
> > On Fri, 2014-03-28 at 12:07 +0800, Wangyufen wrote:
> > []
> >> diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
> > []
> >> @@ -143,7 +143,7 @@ static __inline__ __be32 addr_bit_set(const void *token, int fn_bit)
> >> addr[fn_bit >> 5];
> >> }
> >
> > Perhaps all the __inline__ uses could be changed to inline too.
>
> Or rather, deleted completely, this is a *.c file after all.
Maybe right. There are a lot though just in net/
$ git ls-files net | grep "\.c$" | \
xargs grep -Pw "_{0,2}inline_{0,2}" | wc -l
1512
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH net-next v2 3/3] ipv6: fix checkpatch errors of "foo*" and "foo * bar"
2014-03-28 5:47 ` Joe Perches
@ 2014-03-28 9:33 ` wangyufen
2014-03-28 17:09 ` David Miller
0 siblings, 1 reply; 15+ messages in thread
From: wangyufen @ 2014-03-28 9:33 UTC (permalink / raw)
To: Joe Perches; +Cc: David Miller, netdev
On 2014/3/28 13:47, Joe Perches wrote:
> On Fri, 2014-03-28 at 01:40 -0400, David Miller wrote:
>> From: Joe Perches <joe@perches.com>
>> Date: Thu, 27 Mar 2014 21:22:01 -0700
>>
>>> On Fri, 2014-03-28 at 12:07 +0800, Wangyufen wrote:
>>> []
>>>> diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
>>> []
>>>> @@ -143,7 +143,7 @@ static __inline__ __be32 addr_bit_set(const void *token, int fn_bit)
>>>> addr[fn_bit >> 5];
>>>> }
>>>
>>> Perhaps all the __inline__ uses could be changed to inline too.
>>
>> Or rather, deleted completely, this is a *.c file after all.
>
> Maybe right. There are a lot though just in net/
>
> $ git ls-files net | grep "\.c$" | \
> xargs grep -Pw "_{0,2}inline_{0,2}" | wc -l
> 1512
>
>
>
>
>
Or change to inline and move the whole function to ip6_fib.h?
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH net-next v2 3/3] ipv6: fix checkpatch errors of "foo*" and "foo * bar"
2014-03-28 5:40 ` David Miller
2014-03-28 5:47 ` Joe Perches
@ 2014-03-28 10:17 ` Hannes Frederic Sowa
2014-03-28 10:54 ` David Laight
1 sibling, 1 reply; 15+ messages in thread
From: Hannes Frederic Sowa @ 2014-03-28 10:17 UTC (permalink / raw)
To: David Miller; +Cc: joe, wangyufen, netdev
On Fri, Mar 28, 2014 at 01:40:12AM -0400, David Miller wrote:
> From: Joe Perches <joe@perches.com>
> Date: Thu, 27 Mar 2014 21:22:01 -0700
>
> > On Fri, 2014-03-28 at 12:07 +0800, Wangyufen wrote:
> > []
> >> diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
> > []
> >> @@ -143,7 +143,7 @@ static __inline__ __be32 addr_bit_set(const void *token, int fn_bit)
> >> addr[fn_bit >> 5];
> >> }
> >
> > Perhaps all the __inline__ uses could be changed to inline too.
>
> Or rather, deleted completely, this is a *.c file after all.
Smart-arsing:
Removing inline keyword makes the function visible to tracing if
it didn't get inlined. I think this is a nice side-effect because debug
kernels are often compiled with less aggressive inlining options
(readable asm kconfig option).
^ permalink raw reply [flat|nested] 15+ messages in thread
* RE: [PATCH net-next v2 3/3] ipv6: fix checkpatch errors of "foo*" and "foo * bar"
2014-03-28 10:17 ` Hannes Frederic Sowa
@ 2014-03-28 10:54 ` David Laight
2014-03-28 18:16 ` Hannes Frederic Sowa
0 siblings, 1 reply; 15+ messages in thread
From: David Laight @ 2014-03-28 10:54 UTC (permalink / raw)
To: 'Hannes Frederic Sowa', David Miller; +Cc: joe, wangyufen, netdev
From: Hannes Frederic Sowa
> > > Perhaps all the __inline__ uses could be changed to inline too.
> >
> > Or rather, deleted completely, this is a *.c file after all.
Personally I wouldn't do a blanket removal of 'inline' from .c files.
But I will agree that some large functions have been inappropriately
marked 'inline'.
The complier doesn't always make the right guess.
> Smart-arsing:
>
> Removing inline keyword makes the function visible to tracing if
> it didn't get inlined. I think this is a nice side-effect because debug
> kernels are often compiled with less aggressive inlining options
> (readable asm kconfig option).
I want to debug the same binary that will run in production.
Dodgy code can be affected by all sorts of compiler options.
The best one was a problem with the shell deleting the last
character of a $(...) substitution.
The code ran off the beginning of an on-stack buffer when trimming
trailing '\n' and 'found' a '\n' byte lurking in the unwritten
stack (this was well down the stack, and had been written much,
much earlier).
The error was only ever likely on big-endian systems (the msb of
a word is less likely to be '\n'.
David
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH net-next v2 3/3] ipv6: fix checkpatch errors of "foo*" and "foo * bar"
2014-03-28 4:07 ` [PATCH net-next v2 3/3] ipv6: fix checkpatch errors of "foo*" and "foo * bar" Wangyufen
2014-03-28 4:22 ` Joe Perches
@ 2014-03-28 13:30 ` Sergei Shtylyov
1 sibling, 0 replies; 15+ messages in thread
From: Sergei Shtylyov @ 2014-03-28 13:30 UTC (permalink / raw)
To: Wangyufen, davem, netdev
Hello.
On 28-03-2014 8:07, Wangyufen wrote:
> From: Wang Yufen <wangyufen@huawei.com>
> ERROR: "(foo*)" should be "(foo *)"
> ERROR: "foo * bar" should be "foo *bar"
>
> Suggested-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
I didn't really suggest to you to make this patch, I just commented on it.
You can instead add:
Acked-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
> Signed-off-by: Wang Yufen <wangyufen@huawei.com>
> ---
> net/ipv6/ip6_fib.c | 30 +++++++++++++++---------------
> 1 file changed, 15 insertions(+), 15 deletions(-)
WBR, Sergei
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH net-next v2 3/3] ipv6: fix checkpatch errors of "foo*" and "foo * bar"
2014-03-28 9:33 ` wangyufen
@ 2014-03-28 17:09 ` David Miller
0 siblings, 0 replies; 15+ messages in thread
From: David Miller @ 2014-03-28 17:09 UTC (permalink / raw)
To: wangyufen; +Cc: joe, netdev
From: wangyufen <wangyufen@huawei.com>
Date: Fri, 28 Mar 2014 17:33:54 +0800
> On 2014/3/28 13:47, Joe Perches wrote:
>> On Fri, 2014-03-28 at 01:40 -0400, David Miller wrote:
>>> From: Joe Perches <joe@perches.com>
>>> Date: Thu, 27 Mar 2014 21:22:01 -0700
>>>
>>>> On Fri, 2014-03-28 at 12:07 +0800, Wangyufen wrote:
>>>> []
>>>>> diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
>>>> []
>>>>> @@ -143,7 +143,7 @@ static __inline__ __be32 addr_bit_set(const void *token, int fn_bit)
>>>>> addr[fn_bit >> 5];
>>>>> }
>>>>
>>>> Perhaps all the __inline__ uses could be changed to inline too.
>>>
>>> Or rather, deleted completely, this is a *.c file after all.
>>
>> Maybe right. There are a lot though just in net/
>>
>> $ git ls-files net | grep "\.c$" | \
>> xargs grep -Pw "_{0,2}inline_{0,2}" | wc -l
>> 1512
>>
>>
>>
>>
>>
>
> Or change to inline and move the whole function to ip6_fib.h?
No, that is not desirable. The whole point is to not export the interface
outside of the *.c file, and to let the compiler make inlining decisions
since it can see all of the call sites.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH net-next v2 3/3] ipv6: fix checkpatch errors of "foo*" and "foo * bar"
2014-03-28 10:54 ` David Laight
@ 2014-03-28 18:16 ` Hannes Frederic Sowa
0 siblings, 0 replies; 15+ messages in thread
From: Hannes Frederic Sowa @ 2014-03-28 18:16 UTC (permalink / raw)
To: David Laight; +Cc: David Miller, joe, wangyufen, netdev
On Fri, Mar 28, 2014 at 10:54:13AM +0000, David Laight wrote:
> From: Hannes Frederic Sowa
> > > > Perhaps all the __inline__ uses could be changed to inline too.
> > >
> > > Or rather, deleted completely, this is a *.c file after all.
>
> Personally I wouldn't do a blanket removal of 'inline' from .c files.
> But I will agree that some large functions have been inappropriately
> marked 'inline'.
Does inline keyword actually make a difference in case the function is
static? I guess not (except for function profiling if a prologue should
get included, thus the change in visibility for tracing).
> The complier doesn't always make the right guess.
>
> > Smart-arsing:
> >
> > Removing inline keyword makes the function visible to tracing if
> > it didn't get inlined. I think this is a nice side-effect because debug
> > kernels are often compiled with less aggressive inlining options
> > (readable asm kconfig option).
>
> I want to debug the same binary that will run in production.
> Dodgy code can be affected by all sorts of compiler options.
I agree. But status quo is that your binaries look very different if
you have DEBUG_SECTION_MISMATCH or READABLE_ASM defined.
The change in tracing visibility is already the case if you (like
me) compile your kernel with DEBUG_SECTION_MISMATCH wich enables
no-inline-functions-called-once, because this option does also not
respect inline keyword.
> The best one was a problem with the shell deleting the last
> character of a $(...) substitution.
> The code ran off the beginning of an on-stack buffer when trimming
> trailing '\n' and 'found' a '\n' byte lurking in the unwritten
> stack (this was well down the stack, and had been written much,
> much earlier).
> The error was only ever likely on big-endian systems (the msb of
> a word is less likely to be '\n'.
Heh. :)
Greetings,
Hannes
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH net-next v2 0/3] ipv6: fix checkpatch errors and warnings.
2014-03-28 4:07 [PATCH net-next v2 0/3] ipv6: fix checkpatch errors and warnings Wangyufen
` (2 preceding siblings ...)
2014-03-28 4:07 ` [PATCH net-next v2 3/3] ipv6: fix checkpatch errors of "foo*" and "foo * bar" Wangyufen
@ 2014-03-29 22:16 ` David Miller
3 siblings, 0 replies; 15+ messages in thread
From: David Miller @ 2014-03-29 22:16 UTC (permalink / raw)
To: wangyufen; +Cc: netdev
From: Wangyufen <wangyufen@huawei.com>
Date: Fri, 28 Mar 2014 12:07:01 +0800
> From: Wang Yufen <wangyufen@huawei.com>
>
> Wang Yufen (3):
> ipv6: fix checkpatch errors comments and space
> ipv6: fix checkpatch errors of brace and trailing statements
> ipv6: fix checkpatch errors of foo
>
> v2: Reindent the lines as suggested by Sergei Shtylyov.
Series applied, thank you.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH net-next v2 0/3] ipv6: fix checkpatch errors and warnings.
@ 2014-03-26 2:37 Wangyufen
0 siblings, 0 replies; 15+ messages in thread
From: Wangyufen @ 2014-03-26 2:37 UTC (permalink / raw)
To: davem, netdev; +Cc: Wang Yufen
From: Wang Yufen <wangyufen@huawei.com>
Wang Yufen (3):
ipv6: fix checkpatch errors comments and space
ipv6: fix checkpatch errors of brace and trailing statements
ipv6: fix checkpatch errors of foo
v2: Reindent the lines as suggested by Sergei Shtylyov.
net/ipv6/ip6_fib.c | 74 +++---
1 file changed, 37 insertions(+), 37 deletions(-)
--
1.7.12
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2014-03-29 22:16 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-28 4:07 [PATCH net-next v2 0/3] ipv6: fix checkpatch errors and warnings Wangyufen
2014-03-28 4:07 ` [PATCH net-next v2 1/3] ipv6: fix checkpatch errors comments and space Wangyufen
2014-03-28 4:07 ` [PATCH net-next v2 2/3] ipv6: fix checkpatch errors of brace and trailing statements Wangyufen
2014-03-28 4:07 ` [PATCH net-next v2 3/3] ipv6: fix checkpatch errors of "foo*" and "foo * bar" Wangyufen
2014-03-28 4:22 ` Joe Perches
2014-03-28 5:40 ` David Miller
2014-03-28 5:47 ` Joe Perches
2014-03-28 9:33 ` wangyufen
2014-03-28 17:09 ` David Miller
2014-03-28 10:17 ` Hannes Frederic Sowa
2014-03-28 10:54 ` David Laight
2014-03-28 18:16 ` Hannes Frederic Sowa
2014-03-28 13:30 ` Sergei Shtylyov
2014-03-29 22:16 ` [PATCH net-next v2 0/3] ipv6: fix checkpatch errors and warnings David Miller
-- strict thread matches above, loose matches on Subject: below --
2014-03-26 2:37 Wangyufen
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.