All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] net: ping_check_bind_addr() etc. can be static
@ 2013-06-09 12:24 Fengguang Wu
  2013-06-09 12:28 ` [PATCH net-next] net: ipv6: ping_v6_seq_show() " Fengguang Wu
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Fengguang Wu @ 2013-06-09 12:24 UTC (permalink / raw)
  To: netdev; +Cc: Lorenzo Colitti

net/ipv4/ping.c:286:5: sparse: symbol 'ping_check_bind_addr' was not declared. Should it be static?
net/ipv4/ping.c:355:6: sparse: symbol 'ping_set_saddr' was not declared. Should it be static?
net/ipv4/ping.c:370:6: sparse: symbol 'ping_clear_saddr' was not declared. Should it be static?

net/ipv6/ping.c:60:5: sparse: symbol 'dummy_ipv6_recv_error' was not declared. Should it be static?
net/ipv6/ping.c:64:5: sparse: symbol 'dummy_ip6_datagram_recv_ctl' was not declared. Should it be static?
net/ipv6/ping.c:69:5: sparse: symbol 'dummy_icmpv6_err_convert' was not declared. Should it be static?
net/ipv6/ping.c:73:6: sparse: symbol 'dummy_ipv6_icmp_error' was not declared. Should it be static?
net/ipv6/ping.c:75:5: sparse: symbol 'dummy_ipv6_chk_addr' was not declared. Should it be static?

Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---
 net/ipv4/ping.c |    6 +++---
 net/ipv6/ping.c |   10 +++++-----
 2 files changed, 8 insertions(+), 8 deletions(-)

--- linux-next.orig/net/ipv4/ping.c	2013-06-09 20:19:41.000000000 +0800
+++ linux-next/net/ipv4/ping.c	2013-06-09 20:20:08.105728488 +0800
@@ -283,7 +283,7 @@ void ping_close(struct sock *sk, long ti
 EXPORT_SYMBOL_GPL(ping_close);
 
 /* Checks the bind address and possibly modifies sk->sk_bound_dev_if. */
-int ping_check_bind_addr(struct sock *sk, struct inet_sock *isk,
+static int ping_check_bind_addr(struct sock *sk, struct inet_sock *isk,
 			 struct sockaddr *uaddr, int addr_len) {
 	struct net *net = sock_net(sk);
 	if (sk->sk_family == AF_INET) {
@@ -352,7 +352,7 @@ int ping_check_bind_addr(struct sock *sk
 	return 0;
 }
 
-void ping_set_saddr(struct sock *sk, struct sockaddr *saddr)
+static void ping_set_saddr(struct sock *sk, struct sockaddr *saddr)
 {
 	if (saddr->sa_family == AF_INET) {
 		struct inet_sock *isk = inet_sk(sk);
@@ -367,7 +367,7 @@ void ping_set_saddr(struct sock *sk, str
 	}
 }
 
-void ping_clear_saddr(struct sock *sk, int dif)
+static void ping_clear_saddr(struct sock *sk, int dif)
 {
 	sk->sk_bound_dev_if = dif;
 	if (sk->sk_family == AF_INET) {
--- linux-next.orig/net/ipv6/ping.c	2013-06-09 20:19:41.000000000 +0800
+++ linux-next/net/ipv6/ping.c	2013-06-09 20:20:11.085728559 +0800
@@ -57,22 +57,22 @@ static struct inet_protosw pingv6_protos
 
 
 /* Compatibility glue so we can support IPv6 when it's compiled as a module */
-int dummy_ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len)
+static int dummy_ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len)
 {
 	return -EAFNOSUPPORT;
 }
-int dummy_ip6_datagram_recv_ctl(struct sock *sk, struct msghdr *msg,
+static int dummy_ip6_datagram_recv_ctl(struct sock *sk, struct msghdr *msg,
 				 struct sk_buff *skb)
 {
 	return -EAFNOSUPPORT;
 }
-int dummy_icmpv6_err_convert(u8 type, u8 code, int *err)
+static int dummy_icmpv6_err_convert(u8 type, u8 code, int *err)
 {
 	return -EAFNOSUPPORT;
 }
-void dummy_ipv6_icmp_error(struct sock *sk, struct sk_buff *skb, int err,
+static void dummy_ipv6_icmp_error(struct sock *sk, struct sk_buff *skb, int err,
 			    __be16 port, u32 info, u8 *payload) {}
-int dummy_ipv6_chk_addr(struct net *net, const struct in6_addr *addr,
+static int dummy_ipv6_chk_addr(struct net *net, const struct in6_addr *addr,
 			const struct net_device *dev, int strict)
 {
 	return 0;

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

* [PATCH net-next] net: ipv6: ping_v6_seq_show() can be static
  2013-06-09 12:24 [PATCH net-next] net: ping_check_bind_addr() etc. can be static Fengguang Wu
@ 2013-06-09 12:28 ` Fengguang Wu
  2013-06-12  8:17 ` [PATCH net-next] net: ping_check_bind_addr() etc. " David Miller
  2013-06-12 13:04 ` [PATCH v2 " Fengguang Wu
  2 siblings, 0 replies; 6+ messages in thread
From: Fengguang Wu @ 2013-06-09 12:28 UTC (permalink / raw)
  To: netdev; +Cc: Lorenzo Colitti

TO: Lorenzo Colitti <lorenzo@google.com>
CC: netdev@vger.kernel.org 
CC: linux-kernel@vger.kernel.org 

Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---
 net/ipv6/ping.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Sorry I just realized this patch could be folded into the previous
one.. It was two patches because the problems are found in two times.

--- linux-next.orig/net/ipv6/ping.c	2013-06-09 20:20:11.085728559 +0800
+++ linux-next/net/ipv6/ping.c	2013-06-09 20:25:25.913736041 +0800
@@ -198,7 +198,7 @@ static void *ping_v6_seq_start(struct se
 	return ping_seq_start(seq, pos, AF_INET6);
 }
 
-int ping_v6_seq_show(struct seq_file *seq, void *v)
+static int ping_v6_seq_show(struct seq_file *seq, void *v)
 {
 	if (v == SEQ_START_TOKEN) {
 		seq_puts(seq, IPV6_SEQ_DGRAM_HEADER);

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

* Re: [PATCH net-next] net: ping_check_bind_addr() etc. can be static
  2013-06-09 12:24 [PATCH net-next] net: ping_check_bind_addr() etc. can be static Fengguang Wu
  2013-06-09 12:28 ` [PATCH net-next] net: ipv6: ping_v6_seq_show() " Fengguang Wu
@ 2013-06-12  8:17 ` David Miller
  2013-06-12 10:26   ` Fengguang Wu
  2013-06-12 13:04 ` [PATCH v2 " Fengguang Wu
  2 siblings, 1 reply; 6+ messages in thread
From: David Miller @ 2013-06-12  8:17 UTC (permalink / raw)
  To: fengguang.wu; +Cc: netdev, lorenzo

From: Fengguang Wu <fengguang.wu@intel.com>
Date: Sun, 9 Jun 2013 20:24:26 +0800

>  /* Checks the bind address and possibly modifies sk->sk_bound_dev_if. */
> -int ping_check_bind_addr(struct sock *sk, struct inet_sock *isk,
> +static int ping_check_bind_addr(struct sock *sk, struct inet_sock *isk,
>  			 struct sockaddr *uaddr, int addr_len) {

In all of these cases, you have to fix the indentation of all of the
argument lines when the change the location of the openning
parenthesis of the first line of the function definition.

That's because in the networking we indent function declarations
in the following way:

int foo(int arg1, int arg2, int arg3,
	int arg4, int arg5)

Specifically, the arguments that are declared on the second and
subsequent lines must start at the first column after the openning
parenthesis.  This must be done using the appropriate number of
TAB and space characters necessary to achieve that exact column.

Please fix this up and combine your two patches into one.

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

* Re: [PATCH net-next] net: ping_check_bind_addr() etc. can be static
  2013-06-12  8:17 ` [PATCH net-next] net: ping_check_bind_addr() etc. " David Miller
@ 2013-06-12 10:26   ` Fengguang Wu
  0 siblings, 0 replies; 6+ messages in thread
From: Fengguang Wu @ 2013-06-12 10:26 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, lorenzo

On Wed, Jun 12, 2013 at 01:17:52AM -0700, David Miller wrote:
> From: Fengguang Wu <fengguang.wu@intel.com>
> Date: Sun, 9 Jun 2013 20:24:26 +0800
> 
> >  /* Checks the bind address and possibly modifies sk->sk_bound_dev_if. */
> > -int ping_check_bind_addr(struct sock *sk, struct inet_sock *isk,
> > +static int ping_check_bind_addr(struct sock *sk, struct inet_sock *isk,
> >  			 struct sockaddr *uaddr, int addr_len) {
> 
> In all of these cases, you have to fix the indentation of all of the
> argument lines when the change the location of the openning
> parenthesis of the first line of the function definition.
> 
> That's because in the networking we indent function declarations
> in the following way:
> 
> int foo(int arg1, int arg2, int arg3,
> 	int arg4, int arg5)
> 
> Specifically, the arguments that are declared on the second and
> subsequent lines must start at the first column after the openning
> parenthesis.  This must be done using the appropriate number of
> TAB and space characters necessary to achieve that exact column.
> 
> Please fix this up and combine your two patches into one.

OK I'll rework the patch, thank you for the kind tips!

Thanks,
Fengguang

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

* [PATCH v2 net-next] net: ping_check_bind_addr() etc. can be static
  2013-06-09 12:24 [PATCH net-next] net: ping_check_bind_addr() etc. can be static Fengguang Wu
  2013-06-09 12:28 ` [PATCH net-next] net: ipv6: ping_v6_seq_show() " Fengguang Wu
  2013-06-12  8:17 ` [PATCH net-next] net: ping_check_bind_addr() etc. " David Miller
@ 2013-06-12 13:04 ` Fengguang Wu
  2013-06-13  8:37   ` David Miller
  2 siblings, 1 reply; 6+ messages in thread
From: Fengguang Wu @ 2013-06-12 13:04 UTC (permalink / raw)
  To: netdev; +Cc: Lorenzo Colitti

net/ipv4/ping.c:286:5: sparse: symbol 'ping_check_bind_addr' was not declared. Should it be static?
net/ipv4/ping.c:355:6: sparse: symbol 'ping_set_saddr' was not declared. Should it be static?
net/ipv4/ping.c:370:6: sparse: symbol 'ping_clear_saddr' was not declared. Should it be static?

net/ipv6/ping.c:60:5: sparse: symbol 'dummy_ipv6_recv_error' was not declared. Should it be static?
net/ipv6/ping.c:64:5: sparse: symbol 'dummy_ip6_datagram_recv_ctl' was not declared. Should it be static?
net/ipv6/ping.c:69:5: sparse: symbol 'dummy_icmpv6_err_convert' was not declared. Should it be static?
net/ipv6/ping.c:73:6: sparse: symbol 'dummy_ipv6_icmp_error' was not declared. Should it be static?
net/ipv6/ping.c:75:5: sparse: symbol 'dummy_ipv6_chk_addr' was not declared. Should it be static?
net/ipv6/ping.c:201:5: sparse: symbol 'ping_v6_seq_show' was not declared. Should it be static?

Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---
 net/ipv4/ping.c |    8 ++++----
 net/ipv6/ping.c |   18 +++++++++---------
 2 files changed, 13 insertions(+), 13 deletions(-)

--- linux-next.orig/net/ipv4/ping.c	2013-06-12 17:51:56.880494749 +0800
+++ linux-next/net/ipv4/ping.c	2013-06-12 20:58:16.520760450 +0800
@@ -283,8 +283,8 @@ void ping_close(struct sock *sk, long ti
 EXPORT_SYMBOL_GPL(ping_close);
 
 /* Checks the bind address and possibly modifies sk->sk_bound_dev_if. */
-int ping_check_bind_addr(struct sock *sk, struct inet_sock *isk,
-			 struct sockaddr *uaddr, int addr_len) {
+static int ping_check_bind_addr(struct sock *sk, struct inet_sock *isk,
+				struct sockaddr *uaddr, int addr_len) {
 	struct net *net = sock_net(sk);
 	if (sk->sk_family == AF_INET) {
 		struct sockaddr_in *addr = (struct sockaddr_in *) uaddr;
@@ -352,7 +352,7 @@ int ping_check_bind_addr(struct sock *sk
 	return 0;
 }
 
-void ping_set_saddr(struct sock *sk, struct sockaddr *saddr)
+static void ping_set_saddr(struct sock *sk, struct sockaddr *saddr)
 {
 	if (saddr->sa_family == AF_INET) {
 		struct inet_sock *isk = inet_sk(sk);
@@ -367,7 +367,7 @@ void ping_set_saddr(struct sock *sk, str
 	}
 }
 
-void ping_clear_saddr(struct sock *sk, int dif)
+static void ping_clear_saddr(struct sock *sk, int dif)
 {
 	sk->sk_bound_dev_if = dif;
 	if (sk->sk_family == AF_INET) {
--- linux-next.orig/net/ipv6/ping.c	2013-06-12 18:26:51.696544536 +0800
+++ linux-next/net/ipv6/ping.c	2013-06-12 20:59:13.836761812 +0800
@@ -57,23 +57,23 @@ static struct inet_protosw pingv6_protos
 
 
 /* Compatibility glue so we can support IPv6 when it's compiled as a module */
-int dummy_ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len)
+static int dummy_ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len)
 {
 	return -EAFNOSUPPORT;
 }
-int dummy_ip6_datagram_recv_ctl(struct sock *sk, struct msghdr *msg,
-				 struct sk_buff *skb)
+static int dummy_ip6_datagram_recv_ctl(struct sock *sk, struct msghdr *msg,
+				       struct sk_buff *skb)
 {
 	return -EAFNOSUPPORT;
 }
-int dummy_icmpv6_err_convert(u8 type, u8 code, int *err)
+static int dummy_icmpv6_err_convert(u8 type, u8 code, int *err)
 {
 	return -EAFNOSUPPORT;
 }
-void dummy_ipv6_icmp_error(struct sock *sk, struct sk_buff *skb, int err,
-			    __be16 port, u32 info, u8 *payload) {}
-int dummy_ipv6_chk_addr(struct net *net, const struct in6_addr *addr,
-			const struct net_device *dev, int strict)
+static void dummy_ipv6_icmp_error(struct sock *sk, struct sk_buff *skb, int err,
+				  __be16 port, u32 info, u8 *payload) {}
+static int dummy_ipv6_chk_addr(struct net *net, const struct in6_addr *addr,
+			       const struct net_device *dev, int strict)
 {
 	return 0;
 }
@@ -198,7 +198,7 @@ static void *ping_v6_seq_start(struct se
 	return ping_seq_start(seq, pos, AF_INET6);
 }
 
-int ping_v6_seq_show(struct seq_file *seq, void *v)
+static int ping_v6_seq_show(struct seq_file *seq, void *v)
 {
 	if (v == SEQ_START_TOKEN) {
 		seq_puts(seq, IPV6_SEQ_DGRAM_HEADER);

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

* Re: [PATCH v2 net-next] net: ping_check_bind_addr() etc. can be static
  2013-06-12 13:04 ` [PATCH v2 " Fengguang Wu
@ 2013-06-13  8:37   ` David Miller
  0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2013-06-13  8:37 UTC (permalink / raw)
  To: fengguang.wu; +Cc: netdev, lorenzo

From: Fengguang Wu <fengguang.wu@intel.com>
Date: Wed, 12 Jun 2013 21:04:16 +0800

> net/ipv4/ping.c:286:5: sparse: symbol 'ping_check_bind_addr' was not declared. Should it be static?
> net/ipv4/ping.c:355:6: sparse: symbol 'ping_set_saddr' was not declared. Should it be static?
> net/ipv4/ping.c:370:6: sparse: symbol 'ping_clear_saddr' was not declared. Should it be static?
> 
> net/ipv6/ping.c:60:5: sparse: symbol 'dummy_ipv6_recv_error' was not declared. Should it be static?
> net/ipv6/ping.c:64:5: sparse: symbol 'dummy_ip6_datagram_recv_ctl' was not declared. Should it be static?
> net/ipv6/ping.c:69:5: sparse: symbol 'dummy_icmpv6_err_convert' was not declared. Should it be static?
> net/ipv6/ping.c:73:6: sparse: symbol 'dummy_ipv6_icmp_error' was not declared. Should it be static?
> net/ipv6/ping.c:75:5: sparse: symbol 'dummy_ipv6_chk_addr' was not declared. Should it be static?
> net/ipv6/ping.c:201:5: sparse: symbol 'ping_v6_seq_show' was not declared. Should it be static?
> 
> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>

Applied.

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

end of thread, other threads:[~2013-06-13  8:37 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-09 12:24 [PATCH net-next] net: ping_check_bind_addr() etc. can be static Fengguang Wu
2013-06-09 12:28 ` [PATCH net-next] net: ipv6: ping_v6_seq_show() " Fengguang Wu
2013-06-12  8:17 ` [PATCH net-next] net: ping_check_bind_addr() etc. " David Miller
2013-06-12 10:26   ` Fengguang Wu
2013-06-12 13:04 ` [PATCH v2 " Fengguang Wu
2013-06-13  8:37   ` 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.