]> err.no Git - linux-2.6/blobdiff - net/rxrpc/transport.c
[NET]: Convert xtime.tv_sec to get_seconds()
[linux-2.6] / net / rxrpc / transport.c
index 465efc86fccf1f253cf93a4e5705017e6e1dd83d..8e57be2df93625867d470eb5185fe22114ec513d 100644 (file)
@@ -9,7 +9,6 @@
  * 2 of the License, or (at your option) any later version.
  */
 
-#include <linux/sched.h>
 #include <linux/slab.h>
 #include <linux/module.h>
 #include <rxrpc/transport.h>
@@ -31,7 +30,6 @@
 #endif
 #include <linux/errqueue.h>
 #include <asm/uaccess.h>
-#include <asm/checksum.h>
 #include "internal.h"
 
 struct errormsg {
@@ -331,10 +329,10 @@ static int rxrpc_incoming_msg(struct rxrpc_transport *trans,
        msg->state = RXRPC_MSG_RECEIVED;
        skb_get_timestamp(pkt, &msg->stamp);
        if (msg->stamp.tv_sec == 0) {
-               do_gettimeofday(&msg->stamp); 
-               if (pkt->sk) 
+               do_gettimeofday(&msg->stamp);
+               if (pkt->sk)
                        sock_enable_timestamp(pkt->sk);
-       } 
+       }
        msg->seq = ntohl(msg->hdr.seq);
 
        /* attach the packet */
@@ -381,11 +379,10 @@ static int rxrpc_incoming_msg(struct rxrpc_transport *trans,
 
                /* allocate a new message record */
                ret = -ENOMEM;
-               msg = kmalloc(sizeof(struct rxrpc_message), GFP_KERNEL);
+               msg = kmemdup(jumbomsg, sizeof(struct rxrpc_message), GFP_KERNEL);
                if (!msg)
                        goto error;
 
-               memcpy(msg, jumbomsg, sizeof(*msg));
                list_add_tail(&msg->link, msgq);
 
                /* adjust the jumbo packet */