diff options
| author | Sergey Bashirov <sergeybashirov@gmail.com> | 2025-07-18 11:09:56 +0300 |
|---|---|---|
| committer | Chuck Lever <chuck.lever@oracle.com> | 2025-09-22 02:24:50 +0300 |
| commit | c97b737ef8f10f28424822c139e3b22b9e9bcc2b (patch) | |
| tree | 05d138434e690d17f9cbb35197e5d2c2bb61fcfd /include/linux | |
| parent | 2ee3a75e42081db3d951c0893f5d654f16d1c0e8 (diff) | |
| download | linux-c97b737ef8f10f28424822c139e3b22b9e9bcc2b.tar.xz | |
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>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/sunrpc/xdr.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h index 8a9ec617cf66..8d354015d762 100644 --- a/include/linux/sunrpc/xdr.h +++ b/include/linux/sunrpc/xdr.h @@ -721,7 +721,7 @@ xdr_stream_decode_u64(struct xdr_stream *xdr, __u64 *ptr) * @len: size of buffer pointed to by @ptr * * Return values: - * On success, returns size of object stored in @ptr + * %0 on success * %-EBADMSG on XDR buffer overflow */ static inline ssize_t @@ -732,7 +732,7 @@ xdr_stream_decode_opaque_fixed(struct xdr_stream *xdr, void *ptr, size_t len) if (unlikely(!p)) return -EBADMSG; xdr_decode_opaque_fixed(p, ptr, len); - return len; + return 0; } /** |
