]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
net/sctp/socket.c: squish warning
authorAndrew Morton <akpm@linux-foundation.org>
Mon, 21 Dec 2009 14:25:06 +0000 (14:25 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 4 Jan 2010 05:25:53 +0000 (21:25 -0800)
net/sctp/socket.c: In function 'sctp_setsockopt_autoclose':
net/sctp/socket.c:2090: warning: comparison is always false due to limited range of data type

Cc: Andrei Pelinescu-Onciul <andrei@iptel.org>
Cc: Vlad Yasevich <vladislav.yasevich@hp.com>
Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sctp/socket.c

index 89ab66e54740240759c8329eb8e7da9ddf2080f9..67fdac9d2d3382e566c2f91d26d13d2bde4a5689 100644 (file)
@@ -2087,8 +2087,7 @@ static int sctp_setsockopt_autoclose(struct sock *sk, char __user *optval,
        if (copy_from_user(&sp->autoclose, optval, optlen))
                return -EFAULT;
        /* make sure it won't exceed MAX_SCHEDULE_TIMEOUT */
-       if (sp->autoclose > (MAX_SCHEDULE_TIMEOUT / HZ) )
-               sp->autoclose = (__u32)(MAX_SCHEDULE_TIMEOUT / HZ) ;
+       sp->autoclose = min_t(long, sp->autoclose, MAX_SCHEDULE_TIMEOUT / HZ);
 
        return 0;
 }