diff options
author | fan.du <fan.du@windriver.com> | 2013-07-22 02:21:09 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-07-24 17:24:56 -0400 |
commit | 9225b23057aeba13957e8033f69a554dc246a80e (patch) | |
tree | 9b6b4a8ad37fe06fffdeb350a02cac7bdc30cd6d /net/ipv6/ip6_fib.c | |
parent | 86a37def2bba8d22f8b512e7c8a0f6f6e197728c (diff) |
net: ipv6 eliminate parameter "int addrlen" in function fib6_add_1
The "int addrlen" in fib6_add_1 is rebundant, as we can get it from
parameter "struct in6_addr *addr" once we modified its type.
And also fix some coding style issues in fib6_add_1
Signed-off-by: Fan Du <fan.du@windriver.com>
Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/ip6_fib.c')
-rw-r--r-- | net/ipv6/ip6_fib.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c index 5fc9c7a68d8d..8b6c77389a04 100644 --- a/net/ipv6/ip6_fib.c +++ b/net/ipv6/ip6_fib.c | |||
@@ -425,8 +425,8 @@ out: | |||
425 | * node. | 425 | * node. |
426 | */ | 426 | */ |
427 | 427 | ||
428 | static struct fib6_node * fib6_add_1(struct fib6_node *root, void *addr, | 428 | static struct fib6_node *fib6_add_1(struct fib6_node *root, |
429 | int addrlen, int plen, | 429 | struct in6_addr *addr, int plen, |
430 | int offset, int allow_create, | 430 | int offset, int allow_create, |
431 | int replace_required) | 431 | int replace_required) |
432 | { | 432 | { |
@@ -543,7 +543,7 @@ insert_above: | |||
543 | but if it is >= plen, the value is ignored in any case. | 543 | but if it is >= plen, the value is ignored in any case. |
544 | */ | 544 | */ |
545 | 545 | ||
546 | bit = __ipv6_addr_diff(addr, &key->addr, addrlen); | 546 | bit = __ipv6_addr_diff(addr, &key->addr, sizeof(*addr)); |
547 | 547 | ||
548 | /* | 548 | /* |
549 | * (intermediate)[in] | 549 | * (intermediate)[in] |
@@ -822,9 +822,9 @@ int fib6_add(struct fib6_node *root, struct rt6_info *rt, struct nl_info *info) | |||
822 | if (!allow_create && !replace_required) | 822 | if (!allow_create && !replace_required) |
823 | pr_warn("RTM_NEWROUTE with no NLM_F_CREATE or NLM_F_REPLACE\n"); | 823 | pr_warn("RTM_NEWROUTE with no NLM_F_CREATE or NLM_F_REPLACE\n"); |
824 | 824 | ||
825 | fn = fib6_add_1(root, &rt->rt6i_dst.addr, sizeof(struct in6_addr), | 825 | fn = fib6_add_1(root, &rt->rt6i_dst.addr, rt->rt6i_dst.plen, |
826 | rt->rt6i_dst.plen, offsetof(struct rt6_info, rt6i_dst), | 826 | offsetof(struct rt6_info, rt6i_dst), allow_create, |
827 | allow_create, replace_required); | 827 | replace_required); |
828 | 828 | ||
829 | if (IS_ERR(fn)) { | 829 | if (IS_ERR(fn)) { |
830 | err = PTR_ERR(fn); | 830 | err = PTR_ERR(fn); |
@@ -863,7 +863,7 @@ int fib6_add(struct fib6_node *root, struct rt6_info *rt, struct nl_info *info) | |||
863 | /* Now add the first leaf node to new subtree */ | 863 | /* Now add the first leaf node to new subtree */ |
864 | 864 | ||
865 | sn = fib6_add_1(sfn, &rt->rt6i_src.addr, | 865 | sn = fib6_add_1(sfn, &rt->rt6i_src.addr, |
866 | sizeof(struct in6_addr), rt->rt6i_src.plen, | 866 | rt->rt6i_src.plen, |
867 | offsetof(struct rt6_info, rt6i_src), | 867 | offsetof(struct rt6_info, rt6i_src), |
868 | allow_create, replace_required); | 868 | allow_create, replace_required); |
869 | 869 | ||
@@ -882,7 +882,7 @@ int fib6_add(struct fib6_node *root, struct rt6_info *rt, struct nl_info *info) | |||
882 | fn->subtree = sfn; | 882 | fn->subtree = sfn; |
883 | } else { | 883 | } else { |
884 | sn = fib6_add_1(fn->subtree, &rt->rt6i_src.addr, | 884 | sn = fib6_add_1(fn->subtree, &rt->rt6i_src.addr, |
885 | sizeof(struct in6_addr), rt->rt6i_src.plen, | 885 | rt->rt6i_src.plen, |
886 | offsetof(struct rt6_info, rt6i_src), | 886 | offsetof(struct rt6_info, rt6i_src), |
887 | allow_create, replace_required); | 887 | allow_create, replace_required); |
888 | 888 | ||