]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
sunrpc: Change ret code of xdr_stream_decode_opaque_fixed
authorSergey Bashirov <sergeybashirov@gmail.com>
Fri, 18 Jul 2025 08:09:56 +0000 (11:09 +0300)
committerChuck Lever <chuck.lever@oracle.com>
Sun, 21 Sep 2025 23:24:50 +0000 (19:24 -0400)
commitc97b737ef8f10f28424822c139e3b22b9e9bcc2b
tree05d138434e690d17f9cbb35197e5d2c2bb61fcfd
parent2ee3a75e42081db3d951c0893f5d654f16d1c0e8
sunrpc: Change ret code of xdr_stream_decode_opaque_fixed

Since the opaque is fixed in size, the caller already knows how many
bytes were decoded, on success. Thus, xdr_stream_decode_opaque_fixed()
doesn't need to return that value. And, xdr_stream_decode_u32 and _u64
both return zero on success.

This patch simplifies the caller's error checking to avoid potential
integer promotion issues.

Suggested-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Sergey Bashirov <sergeybashirov@gmail.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
include/linux/sunrpc/xdr.h
tools/net/sunrpc/xdrgen/templates/C/typedef/decoder/fixed_length_opaque.j2