netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/2] net: use compat helper functions in compat_sys_recvmmsg
@ 2009-12-10  6:59 Heiko Carstens
  2009-12-10 12:46 ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 3+ messages in thread
From: Heiko Carstens @ 2009-12-10  6:59 UTC (permalink / raw)
  To: David Miller; +Cc: Arnaldo Carvalho de Melo, linux-kernel, netdev

From: Heiko Carstens <heiko.carstens@de.ibm.com>

Use (get|put)_compat_timespec helper functions to simplify the code.

Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
---
 net/compat.c |    7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

Index: linux-2.6/net/compat.c
===================================================================
--- linux-2.6.orig/net/compat.c
+++ linux-2.6/net/compat.c
@@ -763,15 +763,12 @@ asmlinkage long compat_sys_recvmmsg(int 
 		return __sys_recvmmsg(fd, (struct mmsghdr __user *)mmsg, vlen,
 				      flags | MSG_CMSG_COMPAT, NULL);
 
-	if (get_user(ktspec.tv_sec, &timeout->tv_sec) ||
-	    get_user(ktspec.tv_nsec, &timeout->tv_nsec))
+	if (get_compat_timespec(&ktspec, timeout))
 		return -EFAULT;
 
 	datagrams = __sys_recvmmsg(fd, (struct mmsghdr __user *)mmsg, vlen,
 				   flags | MSG_CMSG_COMPAT, &ktspec);
-	if (datagrams > 0 &&
-	    (put_user(ktspec.tv_sec, &timeout->tv_sec) ||
-	     put_user(ktspec.tv_nsec, &timeout->tv_nsec)))
+	if (datagrams > 0 && put_compat_timespec(&ktspec, timeout))
 		datagrams = -EFAULT;
 
 	return datagrams;

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

* Re: [PATCH 2/2] net: use compat helper functions in compat_sys_recvmmsg
  2009-12-10  6:59 [PATCH 2/2] net: use compat helper functions in compat_sys_recvmmsg Heiko Carstens
@ 2009-12-10 12:46 ` Arnaldo Carvalho de Melo
  2009-12-11 23:16   ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Arnaldo Carvalho de Melo @ 2009-12-10 12:46 UTC (permalink / raw)
  To: Heiko Carstens; +Cc: David Miller, linux-kernel, netdev

Em Thu, Dec 10, 2009 at 07:59:15AM +0100, Heiko Carstens escreveu:
> From: Heiko Carstens <heiko.carstens@de.ibm.com>
> 
> Use (get|put)_compat_timespec helper functions to simplify the code.
> 
> Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>

Nice cleanup, thanks!

Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com>

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

* Re: [PATCH 2/2] net: use compat helper functions in compat_sys_recvmmsg
  2009-12-10 12:46 ` Arnaldo Carvalho de Melo
@ 2009-12-11 23:16   ` David Miller
  0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2009-12-11 23:16 UTC (permalink / raw)
  To: acme; +Cc: heiko.carstens, linux-kernel, netdev

From: Arnaldo Carvalho de Melo <acme@redhat.com>
Date: Thu, 10 Dec 2009 10:46:40 -0200

> Em Thu, Dec 10, 2009 at 07:59:15AM +0100, Heiko Carstens escreveu:
>> From: Heiko Carstens <heiko.carstens@de.ibm.com>
>> 
>> Use (get|put)_compat_timespec helper functions to simplify the code.
>> 
>> Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
>> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
> 
> Nice cleanup, thanks!
> 
> Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com>

Applied.

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

end of thread, other threads:[~2009-12-11 23:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-10  6:59 [PATCH 2/2] net: use compat helper functions in compat_sys_recvmmsg Heiko Carstens
2009-12-10 12:46 ` Arnaldo Carvalho de Melo
2009-12-11 23:16   ` 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).