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 <mail@gmelikov.ru>
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #660
This commit is contained in:
Brian Behlendorf 2017-10-10 08:59:17 -07:00 committed by GitHub
parent ce319db57b
commit 0cefc9dbcd

View 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