Skip to contentSkip to conversation

iommu/arm-smmu-v3: clean up some code style issues

PATCH New Bixuan Cui 1 participant 4 messages May 20, 2021

Subsystems (2)
lore
Share & tools
lore

Bixuan Cui

author
#0 lore raw

cover iommu/arm-smmu-v3: clean up some code style issues

Clean up some code style issues.

Bixuan Cui (3):
iommu/arm-smmu-v3: fix missing a blank line after declarations iommu/arm-smmu-v3: Change *array into *const array iommu/arm-smmu-v3: Prefer unsigned int to bare use of unsigned

 drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
Signature · 1 line
2.17.1
author
#1 lore raw

PATCH 1/3 iommu/arm-smmu-v3: fix missing a blank line after declarations

Fixes checkpatch warnings in arm-smmu-v3.c:
WARNING: Missing a blank line after declarations

---
 drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c +5 -0
index 54b2f27b81d4..4f184119c26d 100644
@@ -151,6 +151,7 @@ static void queue_sync_cons_out(struct arm_smmu_queue *q)
 static void queue_inc_cons(struct arm_smmu_ll_queue *q)
 {
 	u32 cons = (Q_WRP(q, q->cons) | Q_IDX(q, q->cons)) + 1;
+
 	q->cons = Q_OVF(q->cons) | Q_WRP(q, cons) | Q_IDX(q, cons);
 }
 
@@ -176,6 +177,7 @@ static int queue_sync_prod_in(struct arm_smmu_queue *q)
 static u32 queue_inc_prod_n(struct arm_smmu_ll_queue *q, int n)
 {
 	u32 prod = (Q_WRP(q, q->prod) | Q_IDX(q, q->prod)) + n;
+
 	return Q_OVF(q->prod) | Q_WRP(q, prod) | Q_IDX(q, prod);
 }
 
@@ -1895,6 +1897,7 @@ static void arm_smmu_domain_free(struct iommu_domain *domain)
 		mutex_unlock(&arm_smmu_asid_lock);
 	} else {
 		struct arm_smmu_s2_cfg *cfg = &smmu_domain->s2_cfg;
+
 		if (cfg->vmid)
 			arm_smmu_bitmap_free(smmu->vmid_map, cfg->vmid);
 	}
@@ -2724,6 +2727,7 @@ static int arm_smmu_init_one_queue(struct arm_smmu_device *smmu,
 static void arm_smmu_cmdq_free_bitmap(void *data)
 {
 	unsigned long *bitmap = data;
+
 	bitmap_free(bitmap);
 }
 
@@ -2939,6 +2943,7 @@ static int arm_smmu_update_gbpa(struct arm_smmu_device *smmu, u32 set, u32 clr)
 static void arm_smmu_free_msis(void *data)
 {
 	struct device *dev = data;
+
 	platform_msi_domain_free_irqs(dev);
 }
 
Signature · 1 line
2.17.1
author
#2 lore raw

PATCH 2/3 iommu/arm-smmu-v3: Change *array into *const array

In reply to Bixuan Cui

Fix checkpatch warning in arm-smmu-v3.c:
static const char * array should probably be static const char * const

---
 drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c +1 -1
index 4f184119c26d..51ce44fe550c 100644
@@ -354,7 +354,7 @@ static void arm_smmu_cmdq_build_sync_cmd(u64 *cmd, struct arm_smmu_device *smmu,
 
 static void arm_smmu_cmdq_skip_err(struct arm_smmu_device *smmu)
 {
-	static const char *cerror_str[] = {
+	static const char * const cerror_str[] = {
 		[CMDQ_ERR_CERROR_NONE_IDX]	= "No error",
 		[CMDQ_ERR_CERROR_ILL_IDX]	= "Illegal command",
 		[CMDQ_ERR_CERROR_ABT_IDX]	= "Abort on command fetch",
Signature · 1 line
2.17.1
author
#3 lore raw

PATCH 3/3 iommu/arm-smmu-v3: Prefer unsigned int to bare use of unsigned

In reply to Bixuan Cui

Fix checkpatch warning in arm-smmu-v3.c:
Prefer 'unsigned int' to bare use of 'unsigned'

---
 drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c +1 -1
index 51ce44fe550c..725b099d0652 100644
@@ -1827,7 +1827,7 @@ static bool arm_smmu_capable(enum iommu_cap cap)
 	}
 }
 
-static struct iommu_domain *arm_smmu_domain_alloc(unsigned type)
+static struct iommu_domain *arm_smmu_domain_alloc(unsigned int type)
 {
 	struct arm_smmu_domain *smmu_domain;
 
Signature · 1 line
2.17.1