]> git.karo-electronics.de Git - karo-tx-linux.git/commit
include/net/sock.h: squelch compiler warning in sk_rmem_schedule()
authorChuck Lever <chuck.lever@oracle.com>
Fri, 7 Sep 2012 00:17:45 +0000 (10:17 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 7 Sep 2012 05:36:01 +0000 (15:36 +1000)
commit61fdb7ce52cc53a5d51e1f189767a411ae5c52c6
tree99becb007bfaebbbecbae72830ec85a74e0533a2
parentf823ae327623f4f5365b7c244c3d094c8b7f0257
include/net/sock.h: squelch compiler warning in sk_rmem_schedule()

In file included from linux/include/linux/tcp.h:227:0,
                 from linux/include/linux/ipv6.h:221,
                 from linux/include/net/ipv6.h:16,
                 from linux/include/linux/sunrpc/clnt.h:26,
                 from linux/net/sunrpc/stats.c:22:
linux/include/net/sock.h: In function `sk_rmem_schedule':
linux/nfs-2.6/include/net/sock.h:1339:13: warning: comparison between
  signed and unsigned integer expressions [-Wsign-compare]

Seen with gcc (GCC) 4.6.3 20120306 (Red Hat 4.6.3-2) using the
-Wextra option.

c76562b6 ("netvm: prevent a stream-specific deadlock") accidentally
replaced the "size" parameter of sk_rmem_schedule() with an unsigned int.
This changes the semantics of the comparison in the return statement.

In sk_wmem_schedule we have syntactically the same comparison, but "size"
is a signed integer.  In addition, __sk_mem_schedule() takes a signed
integer for its "size" parameter, so there is an implicit type conversion
in sk_rmem_schedule() anyway.

Revert the "size" parameter back to a signed integer so that the semantics
of the expressions in both sk_[rw]mem_schedule() are exactly the same.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Mel Gorman <mgorman@suse.de>
Cc: David Miller <davem@davemloft.net>
Cc: Joonsoo Kim <js1304@gmail.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Pekka Enberg <penberg@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/net/sock.h