Skip to content
This repository has been archived by the owner on Feb 26, 2020. It is now read-only.

Commit

Permalink
Add parenthesis to btop and ptob macros
Browse files Browse the repository at this point in the history
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
  • Loading branch information
behlendorf authored Oct 10, 2017
1 parent ce319db commit 0cefc9d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/sys/param.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 0cefc9d

Please sign in to comment.