mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-01-06 16:15:00 +00:00
hv: treewide: fix 'Macro parameter not in brackets'
Add the brackets for Macro parameter to avoid the unintentional
mistakes.
A simple example that may cause mistakes:
#define minus(x) -x
When the following call is made,
z = minus(a-b)
it becomes:
z = -a-b;
where "-a - b" is equivalent to "(-a) - b" rather than "- (a - b)", as
expected.
v2 -> v3:
* convert DMAR_WAIT_COMPLETION to inline function
* remove the macro PIC_PIN_FOREACH and implement the well-formed
for loop in each case
* replace __CPP_STRING with STRINGIFY and remove the unused CPP_STRING
v1 -> v2:
* Remove some changes to function like macro since MISRA-C requires to
use inline functions if it is possible.
These MACRO brackets violations will be fixed together when fixing
other issues related to function like macro.
Tracked-On: #861
Signed-off-by: Shiqing Gao <shiqing.gao@intel.com>
This commit is contained in:
@@ -18,10 +18,10 @@ enum ptdev_vpin_source {
|
||||
};
|
||||
|
||||
#define DEFINE_MSI_SID(name, a, b) \
|
||||
union source_id name = {.msi_id = {.bdf = (a), .entry_nr = (b)}}
|
||||
union source_id (name) = {.msi_id = {.bdf = (a), .entry_nr = (b)} }
|
||||
|
||||
#define DEFINE_IOAPIC_SID(name, a, b) \
|
||||
union source_id name = {.intx_id = {.pin = (a), .src = (b)}}
|
||||
union source_id (name) = {.intx_id = {.pin = (a), .src = (b)} }
|
||||
|
||||
union source_id {
|
||||
uint32_t value;
|
||||
|
||||
Reference in New Issue
Block a user