diff mbox series

[04/10] cifs: Slightly simplify cifs_readdir()

Message ID e3e730c19615971f01ff11238e81721b102997eb.1678885349.git.vl@samba.org (mailing list archive)
State New, archived
Headers show
Series Some cleanups for fs/cifs | expand

Commit Message

Volker Lendecke March 15, 2023, 1:05 p.m. UTC
Use the fact that we use "goto" in the else-branch, this avoids an
indentation level for the success case.

Signed-off-by: Volker Lendecke <vl@samba.org>
---
 fs/cifs/readdir.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/fs/cifs/readdir.c b/fs/cifs/readdir.c
index 7dfa33b6954f..0bca6dc10093 100644
--- a/fs/cifs/readdir.c
+++ b/fs/cifs/readdir.c
@@ -1166,9 +1166,7 @@  int cifs_readdir(struct file *file, struct dir_context *ctx)
 		cifs_dbg(FYI, "fce error %d\n", rc);
 		goto rddir2_exit;
 	}
-	if (current_entry != NULL) {
-		cifs_dbg(FYI, "entry %lld found\n", ctx->pos);
-	} else {
+	if (current_entry == NULL) {
 		if (cfid) {
 			mutex_lock(&cfid->dirents.de_mutex);
 			finished_cached_dirents_count(&cfid->dirents, ctx);
@@ -1177,6 +1175,7 @@  int cifs_readdir(struct file *file, struct dir_context *ctx)
 		cifs_dbg(FYI, "Could not find entry\n");
 		goto rddir2_exit;
 	}
+	cifs_dbg(FYI, "entry %lld found\n", ctx->pos);
 	cifs_dbg(FYI, "loop through %d times filling dir for net buf %p\n",
 		 num_to_fill, cifsFile->srch_inf.ntwrk_buf_start);
 	max_len = tcon->ses->server->ops->calc_smb_size(