diff mbox series

[RFC,2/6] NFSD: Remove a never-true comparison

Message ID 20241017150349.216096-10-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>

fh_size is an unsigned int, thus it can never be less than 0.

Fixes: d8b26071e65e ("NFSD: simplify struct nfsfh")
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 fs/nfsd/nfsfh.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/fs/nfsd/nfsfh.c b/fs/nfsd/nfsfh.c
index 4c5deea0e953..641dfe54fb59 100644
--- a/fs/nfsd/nfsfh.c
+++ b/fs/nfsd/nfsfh.c
@@ -773,7 +773,7 @@  char * SVCFH_fmt(struct svc_fh *fhp)
 	struct knfsd_fh *fh = &fhp->fh_handle;
 	static char buf[2+1+1+64*3+1];
 
-	if (fh->fh_size < 0 || fh->fh_size> 64)
+	if (fh->fh_size > 64)
 		return "bad-fh";
 	sprintf(buf, "%d: %*ph", fh->fh_size, fh->fh_size, fh->fh_raw);
 	return buf;