Skip to contentSkip to conversation

yaffs2: remove redundant condition

PATCH New Heinrich Schuchardt 2 participants 3 messages Apr 15, 2017 – Apr 19, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 yaffs2: remove redundant condition

If !parent, the changed line is not reached.
So there is no need to check the value again.

---
 fs/yaffs2/yaffsfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/yaffs2/yaffsfs.c +1 -1
index 41e5f0108c..ba76a5ccdb 100644
@@ -3018,7 +3018,7 @@ int yaffs_symlink(const YCHAR *oldpath, const YCHAR *newpath)
 		yaffsfs_SetError(-ENFILE);
 	else if (parent->my_dev->read_only)
 		yaffsfs_SetError(-EROFS);
-	else if (parent) {
+	else {
 		obj = yaffs_create_symlink(parent, name, mode, 0, 0, oldpath);
 		if (obj)
 			retVal = 0;
Signature · 1 line
2.11.0
#1 lore raw

PATCH 1/1 yaffs2: remove redundant condition

Quoted 4 lines · Heinrich Schuchardt

If !parent, the changed line is not reached.
So there is no need to check the value again.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170415/98009b7e/attachment.sig>
#2 lore raw

PATCH 1/1 yaffs2: remove redundant condition

In reply to Heinrich Schuchardt
Quoted 5 lines · xypron.glpk at gmx.de

If !parent, the changed line is not reached.
So there is no need to check the value again.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170419/fe55653f/attachment.sig>