From: Danny Al-Gaaf Date: Wed, 7 May 2014 19:18:44 +0000 (+0200) Subject: ECUtil.h: clarify calculation with braces X-Git-Tag: v0.81~45^2~10 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=81c74182aa7e47a777fb570bcae39255a7d2f667;p=ceph.git ECUtil.h: clarify calculation with braces Fix for cppcheck issue: [src/osd/ECUtil.h:61]: (style) Clarify calculation precedence for '%' and '?'. Signed-off-by: Danny Al-Gaaf --- diff --git a/src/osd/ECUtil.h b/src/osd/ECUtil.h index 52d79aab5d9..74ed779d603 100644 --- a/src/osd/ECUtil.h +++ b/src/osd/ECUtil.h @@ -58,9 +58,9 @@ public: return offset - (offset % stripe_width); } uint64_t logical_to_next_stripe_offset(uint64_t offset) const { - return offset % stripe_width ? - offset - (offset % stripe_width) + stripe_width : - offset; + return ((offset % stripe_width) ? + (offset - (offset % stripe_width) + stripe_width) : + offset); } uint64_t aligned_logical_offset_to_chunk_offset(uint64_t offset) const { assert(offset % stripe_width == 0);