Linux CIFS filesystem development
 help / color / mirror / Atom feed
* [PATCH][next] smb: client: remove deadcode check on ret < 0
@ 2024-10-07 15:38 Colin Ian King
  0 siblings, 0 replies; only message in thread
From: Colin Ian King @ 2024-10-07 15:38 UTC (permalink / raw)
  To: Steve French, Paulo Alcantara, Ronnie Sahlberg, Shyam Prasad N,
	Tom Talpey, Bharath SM, linux-cifs, samba-technical
  Cc: kernel-janitors, linux-kernel

The variable ret is assigned zero and never changed in function
collect_samle, hence the check for ret < 0 is always false. Fix
this by removing ret and the check on ret since these are redundant.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 fs/smb/client/compress.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/fs/smb/client/compress.c b/fs/smb/client/compress.c
index 63b5a55b7a57..766b4de13da7 100644
--- a/fs/smb/client/compress.c
+++ b/fs/smb/client/compress.c
@@ -166,7 +166,6 @@ static int collect_sample(const struct iov_iter *iter, ssize_t max, u8 *sample)
 	loff_t start = iter->xarray_start + iter->iov_offset;
 	pgoff_t last, index = start / PAGE_SIZE;
 	size_t len, off, foff;
-	ssize_t ret = 0;
 	void *p;
 	int s = 0;
 
@@ -193,9 +192,6 @@ static int collect_sample(const struct iov_iter *iter, ssize_t max, u8 *sample)
 				memcpy(&sample[s], p, len2);
 				kunmap_local(p);
 
-				if (ret < 0)
-					return ret;
-
 				s += len2;
 
 				if (len2 < SZ_2K || s >= max - SZ_2K)
-- 
2.39.5


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2024-10-07 15:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-07 15:38 [PATCH][next] smb: client: remove deadcode check on ret < 0 Colin Ian King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox