Skip to content

Commit

Permalink
Put parentheses around macro argument.
Browse files Browse the repository at this point in the history
It might be too paranoid but makes it safe to deal with operators
with lower priorities than '+', '<<' for example.
  • Loading branch information
eecsmap authored and kaashoek committed Jul 26, 2024
1 parent 92e60dd commit 343d1ab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// the UART control registers are memory-mapped
// at address UART0. this macro returns the
// address of one of the registers.
#define Reg(reg) ((volatile unsigned char *)(UART0 + reg))
#define Reg(reg) ((volatile unsigned char *)(UART0 + (reg)))

// the UART control registers.
// some have different meanings for
Expand Down

0 comments on commit 343d1ab

Please sign in to comment.