]> git.proxmox.com Git - mirror_spl.git/commitdiff
Add parenthesis to btop and ptob macros
authorBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 10 Oct 2017 15:59:17 +0000 (08:59 -0700)
committerGitHub <noreply@github.com>
Tue, 10 Oct 2017 15:59:17 +0000 (08:59 -0700)
Add missing parenthesis around btop and ptob macros to ensure
operation ordering is preserved after expansion.

Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #660

include/sys/param.h

index 2c9fcd8e931c93b1dd04cc17b49784e52465ddd8..10bf96588f72817c28662626f194769b85278cb4 100644 (file)
@@ -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