libceph: re-phrase ceph_decode_need()
PATCH 1/1 libceph: re-phrase ceph_decode_need()
For some reason, the way ceph_decode_need() is written throws me off whenever I look at it:
if (!likely(ceph_has_room(p, end, n)))
I read it as "not likely ceph has room," which is not what it really means. Despite being a double-negative, which I normally avoid, I like this better:
if (unlikely(!ceph_has_room(p, end, n)))
What do you think?
Signed-off-by Alex Elder <[email protected]>
--- include/linux/ceph/decode.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
include/linux/ceph/decode.h +4 -4
@@ -51,10 +51,10 @@ static inline int ceph_has_room(void **preturn end >= *p && n <= end - *p; } -#define ceph_decode_need (p, end, n, bad) \ - do { \ - if (!likely(ceph_has_room(p, end, n))) \ - goto bad; \ +#define ceph_decode_need (p, end, n, bad) \ + do { \ + if (unlikely(!ceph_has_room(p, end, n))) \ + goto bad; \ } while (0)#define ceph_decode_64_safe (p, end, v, bad) \