|
|
|
[PATCH 9/16] fs/fscache: Remove unnecessary error code assignment | |
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] | |
From: Julia Lawall <julia@xxxxxxx>
In each case, the value of ret is not used. If an error occurs, -ENOBUFS
is returned explicitly.
The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)
// <smpl>
@r@
local idexpression x;
constant C;
@@
if (...) { ...
x = -C
... when != x
(
return <+...x...+>;
|
return NULL;
|
return;
|
* return ...;
)
}
// </smpl>
Signed-off-by: Julia Lawall <julia@xxxxxxx>
---
fs/fscache/page.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/fs/fscache/page.c b/fs/fscache/page.c
index 41c441c..33538ed 100644
--- a/fs/fscache/page.c
+++ b/fs/fscache/page.c
@@ -784,7 +784,6 @@ int __fscache_write_page(struct fscache_cookie *cookie,
if (ret < 0)
goto nomem_free;
- ret = -ENOBUFS;
spin_lock(&cookie->lock);
if (hlist_empty(&cookie->backing_objects))
@@ -854,7 +853,6 @@ submit_failed:
radix_tree_delete(&cookie->stores, page->index);
spin_unlock(&cookie->stores_lock);
page_cache_release(page);
- ret = -ENOBUFS;
goto nobufs;
nobufs_unlock_obj:
--
Linux-cachefs mailing list
Linux-cachefs@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/linux-cachefs
[Linux Resources] [LARTC] [Bugtraq] [Yosemite Forum] [Photo]