From 968b2eaf63ff598e25cf8b6336d09bed38f5d652 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Fri, 15 Nov 2019 14:36:44 +0100 Subject: [PATCH] MISRAC2012-Rule-20.7: use parentheses around macro parameters [a2383] --- src/ble/sm.c | 2 +- src/hci_cmd.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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