Skip to content

Commit

Permalink
socket: remove duplicate declaration of struct timespec
Browse files Browse the repository at this point in the history
struct timespec ts was alreay defined. Reuse the previously
defined one and reduce the memory footprint on the stack by
16 bytes.

Signed-off-by: Hagen Paul Pfeifer <hagen@jauu.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Hagen Paul Pfeifer authored and David S. Miller committed Apr 7, 2010
1 parent c6537d6 commit 842509b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions net/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -619,10 +619,9 @@ void __sock_recv_timestamp(struct msghdr *msg, struct sock *sk,
put_cmsg(msg, SOL_SOCKET, SCM_TIMESTAMP,
sizeof(tv), &tv);
} else {
struct timespec ts;
skb_get_timestampns(skb, &ts);
skb_get_timestampns(skb, &ts[0]);
put_cmsg(msg, SOL_SOCKET, SCM_TIMESTAMPNS,
sizeof(ts), &ts);
sizeof(ts[0]), &ts[0]);
}
}

Expand Down

0 comments on commit 842509b

Please sign in to comment.