Skip to content

Commit

Permalink
net/ipv4/tcp.c: fix min() type mismatch warning
Browse files Browse the repository at this point in the history
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 <akpm@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Andrew Morton authored and David S. Miller committed Oct 1, 2009
1 parent 28ad395 commit 4fdb78d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/ipv4/tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 4fdb78d

Please sign in to comment.