arm/smmu: address some 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". Therefore, some
macro definitions should gain additional parentheses to ensure that all
current and future users will be safe with respect to expansions that
can possibly alter the semantics of the passed-in macro parameter.

No functional change.

Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
This commit is contained in:
Nicola Vetrini authored and Jan Beulich committed 2024-03-11 09:36:20 +01:00
1 parent acb13d1b81
commit e90089db3f
1 file changed
+2 -2
+2 -2
View File
@@ -242,7 +242,7 @@ struct arm_smmu_xen_device {
struct iommu_group *group;
};
#define dev_archdata(dev) ((struct arm_smmu_xen_device *)dev->iommu)
#define dev_archdata(dev) ((struct arm_smmu_xen_device *)(dev)->iommu)
#define dev_iommu_domain(dev) (dev_archdata(dev)->domain)
#define dev_iommu_group(dev) (dev_archdata(dev)->group)
@@ -627,7 +627,7 @@ struct arm_smmu_master_cfg {
};
#define INVALID_SMENDX -1
#define for_each_cfg_sme(cfg, i, idx, num) \
for (i = 0; idx = cfg->smendx[i], i < num; ++i)
for (i = 0; idx = (cfg)->smendx[i], (i) < (num); ++(i))
struct arm_smmu_master {
struct device_node *of_node;
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.