diff options
author | Julia Lawall <julia@diku.dk> | 2010-05-22 12:01:14 +0200 |
---|---|---|
committer | Sage Weil <sage@newdream.net> | 2010-05-29 09:12:41 -0700 |
commit | 7e34bc524ecae3a04d8cc427ee76ddad826a937b (patch) | |
tree | 5065eb0e287e450aef2d8e03e3a18d8f895a4c9e /fs/ceph/osdmap.c | |
parent | a41359fa355e7b450c610ed8e913d5d75c3c9c3b (diff) | |
download | kernel_samsung_tuna-7e34bc524ecae3a04d8cc427ee76ddad826a937b.zip kernel_samsung_tuna-7e34bc524ecae3a04d8cc427ee76ddad826a937b.tar.gz kernel_samsung_tuna-7e34bc524ecae3a04d8cc427ee76ddad826a937b.tar.bz2 |
fs/ceph: Use ERR_CAST
Use ERR_CAST(x) rather than ERR_PTR(PTR_ERR(x)). The former makes more
clear what is the purpose of the operation, which otherwise looks like a
no-op.
In the case of fs/ceph/inode.c, ERR_CAST is not needed, because the type of
the returned value is the same as the type of the enclosing function.
The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)
// <smpl>
@@
type T;
T x;
identifier f;
@@
T f (...) { <+...
- ERR_PTR(PTR_ERR(x))
+ x
...+> }
@@
expression x;
@@
- ERR_PTR(PTR_ERR(x))
+ ERR_CAST(x)
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs/ceph/osdmap.c')
-rw-r--r-- | fs/ceph/osdmap.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ceph/osdmap.c b/fs/ceph/osdmap.c index cfdd8f4..ddc656f 100644 --- a/fs/ceph/osdmap.c +++ b/fs/ceph/osdmap.c @@ -706,7 +706,7 @@ struct ceph_osdmap *osdmap_apply_incremental(void **p, void *end, len, *p, end); newcrush = crush_decode(*p, min(*p+len, end)); if (IS_ERR(newcrush)) - return ERR_PTR(PTR_ERR(newcrush)); + return ERR_CAST(newcrush); } /* new flags? */ |