netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tun: use iov_length()
@ 2007-11-17 13:55 Akinobu Mita
  2007-11-20  6:47 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Akinobu Mita @ 2007-11-17 13:55 UTC (permalink / raw)
  To: netdev; +Cc: vtun, Maxim Krasnyansky

Use iov_length() instead of tun's homemade iov_total().

Cc: Maxim Krasnyansky <maxk@qualcomm.com>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>

---
 drivers/net/tun.c |   15 ++-------------
 1 file changed, 2 insertions(+), 13 deletions(-)

Index: 2.6-mm/drivers/net/tun.c
===================================================================
--- 2.6-mm.orig/drivers/net/tun.c
+++ 2.6-mm/drivers/net/tun.c
@@ -292,17 +292,6 @@ static __inline__ ssize_t tun_get_user(s
 	return count;
 }
 
-static inline size_t iov_total(const struct iovec *iv, unsigned long count)
-{
-	unsigned long i;
-	size_t len;
-
-	for (i = 0, len = 0; i < count; i++)
-		len += iv[i].iov_len;
-
-	return len;
-}
-
 static ssize_t tun_chr_aio_write(struct kiocb *iocb, const struct iovec *iv,
 			      unsigned long count, loff_t pos)
 {
@@ -313,7 +302,7 @@ static ssize_t tun_chr_aio_write(struct 
 
 	DBG(KERN_INFO "%s: tun_chr_write %ld\n", tun->dev->name, count);
 
-	return tun_get_user(tun, (struct iovec *) iv, iov_total(iv, count));
+	return tun_get_user(tun, (struct iovec *) iv, iov_length(iv, count));
 }
 
 /* Put packet to the user space buffer */
@@ -364,7 +353,7 @@ static ssize_t tun_chr_aio_read(struct k
 
 	DBG(KERN_INFO "%s: tun_chr_read\n", tun->dev->name);
 
-	len = iov_total(iv, count);
+	len = iov_length(iv, count);
 	if (len < 0)
 		return -EINVAL;
 

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

* Re: [PATCH] tun: use iov_length()
  2007-11-17 13:55 [PATCH] tun: use iov_length() Akinobu Mita
@ 2007-11-20  6:47 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2007-11-20  6:47 UTC (permalink / raw)
  To: akinobu.mita; +Cc: netdev, vtun, maxk

From: Akinobu Mita <akinobu.mita@gmail.com>
Date: Sat, 17 Nov 2007 22:55:00 +0900

> Use iov_length() instead of tun's homemade iov_total().
> 
> Cc: Maxim Krasnyansky <maxk@qualcomm.com>
> Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>

Applied, thank you.

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

end of thread, other threads:[~2007-11-20  6:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-17 13:55 [PATCH] tun: use iov_length() Akinobu Mita
2007-11-20  6:47 ` 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).