From 81c74182aa7e47a777fb570bcae39255a7d2f667 Mon Sep 17 00:00:00 2001 From: Danny Al-Gaaf Date: Wed, 7 May 2014 21:18:44 +0200 Subject: [PATCH] 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 --- src/osd/ECUtil.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/osd/ECUtil.h b/src/osd/ECUtil.h index 52d79aab5d97e..74ed779d603c0 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); -- 2.39.5