From 0cefc9dbcd9de8a35c51e172edabf2f2ecf15f92 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Tue, 10 Oct 2017 08:59:17 -0700 Subject: [PATCH] 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 Reviewed-by: Giuseppe Di Natale Signed-off-by: Brian Behlendorf Closes #660 --- include/sys/param.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/sys/param.h b/include/sys/param.h index 2c9fcd8e..10bf9658 100644 --- a/include/sys/param.h +++ b/include/sys/param.h @@ -28,8 +28,8 @@ #include /* 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