summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2017-10-10 08:59:17 -0700
committerGitHub <[email protected]>2017-10-10 08:59:17 -0700
commit0cefc9dbcd9de8a35c51e172edabf2f2ecf15f92 (patch)
treee57cf84f730d1a9cc098ad901ed428edf2cd903d
parentce319db57b1662a21d60550e546592c96c3da7a1 (diff)
Add parenthesis to btop and ptob macros
Add missing parenthesis around btop and ptob macros to ensure operation ordering is preserved after expansion. Reviewed-by: George Melikov <[email protected]> Reviewed-by: Giuseppe Di Natale <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #660
-rw-r--r--include/sys/param.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/sys/param.h b/include/sys/param.h
index 2c9fcd8e9..10bf96588 100644
--- a/include/sys/param.h
+++ b/include/sys/param.h
@@ -28,8 +28,8 @@
#include <asm/page.h>
/* Pages to bytes and back */
-#define ptob(pages) (pages << PAGE_SHIFT)
-#define btop(bytes) (bytes >> PAGE_SHIFT)
+#define ptob(pages) ((pages) << PAGE_SHIFT)
+#define btop(bytes) ((bytes) >> PAGE_SHIFT)
#define MAXUID UINT32_MAX