diff --git a/src/ble/sm.c b/src/ble/sm.c index dd03ed3aa..de24816f4 100644 --- a/src/ble/sm.c +++ b/src/ble/sm.c @@ -82,7 +82,7 @@ #define USE_CMAC_ENGINE #endif -#define BTSTACK_TAG32(A,B,C,D) ((A << 24) | (B << 16) | (C << 8) | D) +#define BTSTACK_TAG32(A,B,C,D) (((A) << 24) | ((B) << 16) | ((C) << 8) | (D)) // // SM internal types and globals diff --git a/src/hci_cmd.c b/src/hci_cmd.c index 38bbff7d1..77f7cba89 100644 --- a/src/hci_cmd.c +++ b/src/hci_cmd.c @@ -53,7 +53,7 @@ #include // calculate combined ogf/ocf value -#define OPCODE(ogf, ocf) (ocf | ogf << 10) +#define OPCODE(ogf, ocf) ((ocf) | (ogf) << 10) /** * construct HCI Command based on template