netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Minor net/ fixes
@ 2009-10-07 21:34 Hagen Paul Pfeifer
  2009-10-07 21:34 ` [PATCH 1/3] Fix redeclaration of symbol len Hagen Paul Pfeifer
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Hagen Paul Pfeifer @ 2009-10-07 21:34 UTC (permalink / raw)
  To: netdev; +Cc: davem

Hello netdev, hello davem,

I, ... I mean cgcc stumbled across several dubious code. The
following patches address them. ;)

Hagen

-- 
Hagen Paul Pfeifer <hagen@jauu.net>  ||  http://jauu.net/
Telephone: +49 174 5455209           ||  Key Id: 0x98350C22
Key Fingerprint: 490F 557B 6C48 6D7E 5706 2EA2 4A22 8D45 9835 0C22



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

* [PATCH 1/3] Fix redeclaration of symbol len
  2009-10-07 21:34 Minor net/ fixes Hagen Paul Pfeifer
@ 2009-10-07 21:34 ` Hagen Paul Pfeifer
  2009-10-07 21:43   ` David Miller
  2009-10-07 21:34 ` [PATCH 2/3] Incomplete type for struct in6_addr Hagen Paul Pfeifer
  2009-10-07 21:34 ` [PATCH 3/3] Define cipso_v4_delopt static Hagen Paul Pfeifer
  2 siblings, 1 reply; 7+ messages in thread
From: Hagen Paul Pfeifer @ 2009-10-07 21:34 UTC (permalink / raw)
  To: netdev; +Cc: davem

Function argument len was redeclarated within the
function. This patch fix the redeclaration of symbol 'len'.

Signed-off-by: Hagen Paul Pfeifer <hagen@jauu.net>
---
 net/econet/af_econet.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/net/econet/af_econet.c b/net/econet/af_econet.c
index 6529be3..5e9426a 100644
--- a/net/econet/af_econet.c
+++ b/net/econet/af_econet.c
@@ -457,15 +457,15 @@ static int econet_sendmsg(struct kiocb *iocb, struct socket *sock,
 	iov[0].iov_len = size;
 	for (i = 0; i < msg->msg_iovlen; i++) {
 		void __user *base = msg->msg_iov[i].iov_base;
-		size_t len = msg->msg_iov[i].iov_len;
+		size_t iov_len = msg->msg_iov[i].iov_len;
 		/* Check it now since we switch to KERNEL_DS later. */
-		if (!access_ok(VERIFY_READ, base, len)) {
+		if (!access_ok(VERIFY_READ, base, iov_len)) {
 			mutex_unlock(&econet_mutex);
 			return -EFAULT;
 		}
 		iov[i+1].iov_base = base;
-		iov[i+1].iov_len = len;
-		size += len;
+		iov[i+1].iov_len = iov_len;
+		size += iov_len;
 	}
 
 	/* Get a skbuff (no data, just holds our cb information) */
-- 
1.6.3.GIT


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

* [PATCH 2/3] Incomplete type for struct in6_addr
  2009-10-07 21:34 Minor net/ fixes Hagen Paul Pfeifer
  2009-10-07 21:34 ` [PATCH 1/3] Fix redeclaration of symbol len Hagen Paul Pfeifer
@ 2009-10-07 21:34 ` Hagen Paul Pfeifer
  2009-10-07 21:42   ` David Miller
  2009-10-07 21:34 ` [PATCH 3/3] Define cipso_v4_delopt static Hagen Paul Pfeifer
  2 siblings, 1 reply; 7+ messages in thread
From: Hagen Paul Pfeifer @ 2009-10-07 21:34 UTC (permalink / raw)
  To: netdev; +Cc: davem

if_tunnel.h defines a new struct consisting of struct in6_addr,
but the definition is defined in linux/in6.h - so we must
include them beforehand.

Signed-off-by: Hagen Paul Pfeifer <hagen@jauu.net>
---
 include/linux/if_tunnel.h |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/include/linux/if_tunnel.h b/include/linux/if_tunnel.h
index c53c8e0..8d76cb4 100644
--- a/include/linux/if_tunnel.h
+++ b/include/linux/if_tunnel.h
@@ -5,6 +5,7 @@
 
 #ifdef __KERNEL__
 #include <linux/ip.h>
+#include <linux/in6.h>
 #endif
 
 #define SIOCGETTUNNEL   (SIOCDEVPRIVATE + 0)
-- 
1.6.3.GIT


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

* [PATCH 3/3] Define cipso_v4_delopt static
  2009-10-07 21:34 Minor net/ fixes Hagen Paul Pfeifer
  2009-10-07 21:34 ` [PATCH 1/3] Fix redeclaration of symbol len Hagen Paul Pfeifer
  2009-10-07 21:34 ` [PATCH 2/3] Incomplete type for struct in6_addr Hagen Paul Pfeifer
@ 2009-10-07 21:34 ` Hagen Paul Pfeifer
  2009-10-07 21:46   ` David Miller
  2 siblings, 1 reply; 7+ messages in thread
From: Hagen Paul Pfeifer @ 2009-10-07 21:34 UTC (permalink / raw)
  To: netdev; +Cc: davem

There is no reason that cipso_v4_delopt() is not
defined as a static function.

Signed-off-by: Hagen Paul Pfeifer <hagen@jauu.net>
---
 net/ipv4/cipso_ipv4.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/ipv4/cipso_ipv4.c b/net/ipv4/cipso_ipv4.c
index 039cc1f..1e029dc 100644
--- a/net/ipv4/cipso_ipv4.c
+++ b/net/ipv4/cipso_ipv4.c
@@ -2017,7 +2017,7 @@ req_setattr_failure:
  * values on failure.
  *
  */
-int cipso_v4_delopt(struct ip_options **opt_ptr)
+static int cipso_v4_delopt(struct ip_options **opt_ptr)
 {
 	int hdr_delta = 0;
 	struct ip_options *opt = *opt_ptr;
-- 
1.6.3.GIT


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

* Re: [PATCH 2/3] Incomplete type for struct in6_addr
  2009-10-07 21:34 ` [PATCH 2/3] Incomplete type for struct in6_addr Hagen Paul Pfeifer
@ 2009-10-07 21:42   ` David Miller
  0 siblings, 0 replies; 7+ messages in thread
From: David Miller @ 2009-10-07 21:42 UTC (permalink / raw)
  To: hagen; +Cc: netdev

From: Hagen Paul Pfeifer <hagen@jauu.net>
Date: Wed,  7 Oct 2009 23:34:41 +0200

> if_tunnel.h defines a new struct consisting of struct in6_addr,
> but the definition is defined in linux/in6.h - so we must
> include them beforehand.
> 
> Signed-off-by: Hagen Paul Pfeifer <hagen@jauu.net>

Already fixed in net-next-2.6

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

* Re: [PATCH 1/3] Fix redeclaration of symbol len
  2009-10-07 21:34 ` [PATCH 1/3] Fix redeclaration of symbol len Hagen Paul Pfeifer
@ 2009-10-07 21:43   ` David Miller
  0 siblings, 0 replies; 7+ messages in thread
From: David Miller @ 2009-10-07 21:43 UTC (permalink / raw)
  To: hagen; +Cc: netdev

From: Hagen Paul Pfeifer <hagen@jauu.net>
Date: Wed,  7 Oct 2009 23:34:40 +0200

> Function argument len was redeclarated within the
> function. This patch fix the redeclaration of symbol 'len'.
> 
> Signed-off-by: Hagen Paul Pfeifer <hagen@jauu.net>

In the future please indicate the area you are touching
in the subject line so that it shows up in the header
line of the commit message.  I added "econet: " to your
subject to fix this.

Applied, thanks.

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

* Re: [PATCH 3/3] Define cipso_v4_delopt static
  2009-10-07 21:34 ` [PATCH 3/3] Define cipso_v4_delopt static Hagen Paul Pfeifer
@ 2009-10-07 21:46   ` David Miller
  0 siblings, 0 replies; 7+ messages in thread
From: David Miller @ 2009-10-07 21:46 UTC (permalink / raw)
  To: hagen; +Cc: netdev

From: Hagen Paul Pfeifer <hagen@jauu.net>
Date: Wed,  7 Oct 2009 23:34:42 +0200

> There is no reason that cipso_v4_delopt() is not
> defined as a static function.
> 
> Signed-off-by: Hagen Paul Pfeifer <hagen@jauu.net>

Also applied, thanks.

Same subject line problem, I added "ipv4: " to this one.

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

end of thread, other threads:[~2009-10-07 21:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-07 21:34 Minor net/ fixes Hagen Paul Pfeifer
2009-10-07 21:34 ` [PATCH 1/3] Fix redeclaration of symbol len Hagen Paul Pfeifer
2009-10-07 21:43   ` David Miller
2009-10-07 21:34 ` [PATCH 2/3] Incomplete type for struct in6_addr Hagen Paul Pfeifer
2009-10-07 21:42   ` David Miller
2009-10-07 21:34 ` [PATCH 3/3] Define cipso_v4_delopt static Hagen Paul Pfeifer
2009-10-07 21:46   ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).