]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ECUtil.h: clarify calculation with braces
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Wed, 7 May 2014 19:18:44 +0000 (21:18 +0200)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Wed, 7 May 2014 19:18:44 +0000 (21:18 +0200)
Fix for cppcheck issue:
 [src/osd/ECUtil.h:61]: (style) Clarify calculation
  precedence for '%' and '?'.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
src/osd/ECUtil.h

index 52d79aab5d97e268671a139a68d44a789f55860c..74ed779d603c0354d32f6338892709cb07f0ddc2 100644 (file)
@@ -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);