diff mbox series

[RFC,5/6] NFSD: Remove unused values from nfsd4_encode_components_esc()

Message ID 20241017150349.216096-13-cel@kernel.org (mailing list archive)
State New
Headers show
Series Fix nits found by static analysis | expand

Commit Message

Chuck Lever Oct. 17, 2024, 3:03 p.m. UTC
From: Chuck Lever <chuck.lever@oracle.com>

Clean up. The computed value of @p is saved each time through the
loop but is never used.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 fs/nfsd/nfs4xdr.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index 6633fa06bc91..59de516edc2d 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -2673,13 +2673,10 @@  static __be32 nfsd4_encode_components_esc(struct xdr_stream *xdr, char sep,
 
 		strlen = end - str;
 		if (strlen) {
-			p = xdr_reserve_space(xdr, strlen + 4);
-			if (!p)
+			if (xdr_stream_encode_opaque(xdr, str, strlen) < 0)
 				return nfserr_resource;
-			p = xdr_encode_opaque(p, str, strlen);
 			count++;
-		}
-		else
+		} else
 			end++;
 		if (found_esc)
 			end = next;