From: Andrew Morton Date: Thu, 1 Oct 2009 22:02:20 +0000 (-0700) Subject: net/ipv4/tcp.c: fix min() type mismatch warning X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=4fdb78d3093a347456e108b77d56d493d29071b2;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git net/ipv4/tcp.c: fix min() type mismatch warning net/ipv4/tcp.c: In function 'do_tcp_setsockopt': net/ipv4/tcp.c:2050: warning: comparison of distinct pointer types lacks a cast Signed-off-by: Andrew Morton Signed-off-by: David S. Miller --- diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 5a15e7629d8e..7bb8479b1eaf 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -2047,7 +2047,7 @@ static int do_tcp_setsockopt(struct sock *sk, int level, return -EINVAL; val = strncpy_from_user(name, optval, - min(TCP_CA_NAME_MAX-1, optlen)); + min_t(long, TCP_CA_NAME_MAX-1, optlen)); if (val < 0) return -EFAULT; name[val] = 0;