diff mbox

[net-next-2.6,4/7] sctp: remove useless arguments from get_saddr() call

Message ID 4DB6405B.2060200@cn.fujitsu.com
State Changes Requested, archived
Delegated to: David Miller
Headers show

Commit Message

Wei Yongjun April 26, 2011, 3:47 a.m. UTC
From: Vlad Yasevich <vladislav.yasevich@hp.com>

There is no point in passing a destination address to
a get_saddr() call.

Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
---
 include/net/sctp/structs.h |    1 -
 net/sctp/ipv6.c            |    2 +-
 net/sctp/protocol.c        |    1 -
 net/sctp/transport.c       |    2 +-
 4 files changed, 2 insertions(+), 4 deletions(-)

Comments

David Miller April 26, 2011, 7:12 a.m. UTC | #1
From: Wei Yongjun <yjwei@cn.fujitsu.com>

Date: Tue, 26 Apr 2011 11:47:39 +0800

> @@ -392,11 +392,11 @@ static inline int sctp_v6_addr_match_len(union sctp_addr *s1,

>   */

>  static void sctp_v6_get_saddr(struct sctp_sock *sk,

>  			      struct sctp_transport *t,

> -			      union sctp_addr *daddr,

>  			      struct flowi *fl)

>  {

>  	struct flowi6 *fl6 = &fl->u.ip6;

>  	union sctp_addr *saddr = &t->saddr;

> +	union sctp_addr *daddr = &t->ipaddr;

>  

>  	SCTP_DEBUG_PRINTK("%s: asoc:%p dst:%p daddr:%pI6 ",

>  			  __func__, t->asoc, t->dst, &daddr->v6.sin6_addr);


I really get grumpy when I have to fix up stuff like this:

net/sctp/ipv6.c: In function ‘sctp_v6_get_saddr’:
net/sctp/ipv6.c:382: warning: unused variable ‘daddr’

You guys know I'm going to immediately run make on any patch you send
me and look for new warnings.

Why waste my time and not look for them yourselves before posting the
patch?

This wasn't even one of those cases where the warning goes away at
the end of the patch series, and only exists somewhere in the middle.
Wei Yongjun April 26, 2011, 8:06 a.m. UTC | #2
> From: David Miller <davem@davemloft.net>
> Date: Tue, 26 Apr 2011 00:12:27 -0700 (PDT)
>
>> I really get grumpy when I have to fix up stuff like this:
>>
>> net/sctp/ipv6.c: In function ‘sctp_v6_get_saddr’:
>> net/sctp/ipv6.c:382: warning: unused variable ‘daddr’
> Now I'm even more grumpy, if I only apply the first 3 patches:
>
> net/sctp/ipv6.c: In function ‘sctp_v6_dst_lookup’:
> net/sctp/ipv6.c:259: warning: assignment makes integer from pointer without a cast
>
> it goes away later but you're not testing the intermediate steps
> of your SCTP patch backports and as a result you are going to
> break bisecting.
>
> I'm reverting this patch series, fix this up and actually test
> the intermediate builds and functionality before resubmission.
Hi David

 Sorry for sending those garbage and wasted your time so much,
I will fix those up and do all of the test before resubmit
those patch to you.


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index a98d36f..cd4aea9 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -571,7 +571,6 @@  struct sctp_af {
 					 struct sock *sk);
 	void		(*get_saddr)	(struct sctp_sock *sk,
 					 struct sctp_transport *t,
-					 union sctp_addr *daddr,
 					 struct flowi *fl);
 	void		(*copy_addrlist) (struct list_head *,
 					  struct net_device *);
diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c
index 74fe28c..31b6f35 100644
--- a/net/sctp/ipv6.c
+++ b/net/sctp/ipv6.c
@@ -392,11 +392,11 @@  static inline int sctp_v6_addr_match_len(union sctp_addr *s1,
  */
 static void sctp_v6_get_saddr(struct sctp_sock *sk,
 			      struct sctp_transport *t,
-			      union sctp_addr *daddr,
 			      struct flowi *fl)
 {
 	struct flowi6 *fl6 = &fl->u.ip6;
 	union sctp_addr *saddr = &t->saddr;
+	union sctp_addr *daddr = &t->ipaddr;
 
 	SCTP_DEBUG_PRINTK("%s: asoc:%p dst:%p daddr:%pI6 ",
 			  __func__, t->asoc, t->dst, &daddr->v6.sin6_addr);
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
index 7be5df6..92b8b91 100644
--- a/net/sctp/protocol.c
+++ b/net/sctp/protocol.c
@@ -562,7 +562,6 @@  out:
  */
 static void sctp_v4_get_saddr(struct sctp_sock *sk,
 			      struct sctp_transport *t,
-			      union sctp_addr *daddr,
 			      struct flowi *fl)
 {
 	union sctp_addr *saddr = &t->saddr;
diff --git a/net/sctp/transport.c b/net/sctp/transport.c
index 2544b9b..1fbb920 100644
--- a/net/sctp/transport.c
+++ b/net/sctp/transport.c
@@ -284,7 +284,7 @@  void sctp_transport_route(struct sctp_transport *transport,
 	if (saddr)
 		memcpy(&transport->saddr, saddr, sizeof(union sctp_addr));
 	else
-		af->get_saddr(opt, transport, daddr, &fl);
+		af->get_saddr(opt, transport, &fl);
 
 	if ((transport->param_flags & SPP_PMTUD_DISABLE) && transport->pathmtu) {
 		return;