|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH 1/2] arm/pci: address violations of MISRA C Rule 20.7
MISRA C Rule 20.7 states: "Expressions resulting from the expansion
of macro parameters shall be enclosed in parentheses".
In macros PCI_ERR_VALUE(), PCI_OP_WRITE() and PCI_OP_READ() add the
parentheses around the macro's parameter to prevent against unintended
expansions.
No functional changes.
Signed-off-by: Dmytro Prokopchuk <dmytro_prokopchuk1@xxxxxxxx>
---
xen/arch/arm/pci/pci-access.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/xen/arch/arm/pci/pci-access.c b/xen/arch/arm/pci/pci-access.c
index 2b23d552bb..7074fd9c09 100644
--- a/xen/arch/arm/pci/pci-access.c
+++ b/xen/arch/arm/pci/pci-access.c
@@ -16,7 +16,7 @@
#include <asm/io.h>
#define INVALID_VALUE (~0U)
-#define PCI_ERR_VALUE(len) GENMASK(0, len * 8)
+#define PCI_ERR_VALUE(len) GENMASK(0, (len) * 8)
static const struct pci_ops *get_ops(struct pci_host_bridge *bridge,
pci_sbdf_t sbdf)
@@ -139,14 +139,14 @@ static void pci_config_write(pci_sbdf_t sbdf, unsigned
int reg,
void pci_conf_write##size(pci_sbdf_t sbdf, \
unsigned int reg, type data) \
{ \
- pci_config_write(sbdf, reg, size / 8, data); \
+ pci_config_write(sbdf, reg, (size) / 8, data); \
}
#define PCI_OP_READ(size, type) \
type pci_conf_read##size(pci_sbdf_t sbdf, \
unsigned int reg) \
{ \
- return pci_config_read(sbdf, reg, size / 8); \
+ return pci_config_read(sbdf, reg, (size) / 8); \
}
PCI_OP_READ(8, uint8_t)
--
2.43.0
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |