Skip to contentSkip to conversation

f2fs:remove unnecessary condition judgment

PATCH In review Yuan Zhong 2 participants 2 messages Mar 9, 2015

Subsystems (2)
lore
Share & tools
lore

Yuan Zhong

author
#0 lore raw

PATCH v2 1/3 f2fs:remove unnecessary condition judgment

Remove the unnecessary condition judgment, because 'max_slots' has been initialized to '0' at the beginging of the function, as following:
if (max_slots)

       *max_slots = 0;
---
 fs/f2fs/dir.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/f2fs/dir.c +1 -1
index 590aeef..1f1a1bc 100644
@@ -139,7 +139,7 @@ struct f2fs_dir_entry *find_target_dentry(struct qstr *name, int *max_slots,
 			!memcmp(d->filename[bit_pos], name->name, name->len))
 			goto found;
 
-		if (max_slots && *max_slots >= 0 && max_len > *max_slots) {
+		if (max_slots && max_len > *max_slots) {
 			*max_slots = max_len;
 			max_len = 0;
 		}
Signature · 7 lines
1.7.9.5
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
Reviewed-by on v2 1/3
#1 lore raw
Quoted 8 lines

-----Original Message-----
From: Yuan Zhong [mailto:[email protected]]
Sent: Monday, March 09, 2015 10:44 AM
To: Jaegeuk Kim; ???
Cc: [email protected]; [email protected]; [email protected]
Subject: [f2fs-dev] [PATCH 1/3 v2] f2fs:remove unnecessary condition judgment

Quoted 7 lines

Remove the unnecessary condition judgment, because 'max_slots' has been initialized to '0' at the beginging of the function, as following:
if (max_slots)

       *max_slots = 0;