Skip to content

Commit 993b566

Browse files
Trond Myklebustamschuma-ntap
authored andcommitted
SUNRPC: Silence compiler complaints about tautological comparisons
On 64-bit systems, the compiler will complain that the comparison between SIZE_MAX and the 32-bit unsigned int 'len' is unnecessary. Signed-off-by: Trond Myklebust <[email protected]> Signed-off-by: Anna Schumaker <[email protected]>
1 parent c656a4d commit 993b566

File tree

1 file changed

+1
-1
lines changed
  • include/linux/sunrpc

1 file changed

+1
-1
lines changed

include/linux/sunrpc/xdr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -779,7 +779,7 @@ xdr_stream_decode_uint32_array(struct xdr_stream *xdr,
779779

780780
if (unlikely(xdr_stream_decode_u32(xdr, &len) < 0))
781781
return -EBADMSG;
782-
if (len > SIZE_MAX / sizeof(*p))
782+
if (U32_MAX >= SIZE_MAX / sizeof(*p) && len > SIZE_MAX / sizeof(*p))
783783
return -EBADMSG;
784784
p = xdr_inline_decode(xdr, len * sizeof(*p));
785785
if (unlikely(!p))

0 commit comments

Comments
 (0)