iommu.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] drivers: iommu coding style fix
@ 2021-03-26  9:37 Zhiqi Song
  2021-03-26  9:37 ` [PATCH 1/3] drivers: iommu - " Zhiqi Song
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Zhiqi Song @ 2021-03-26  9:37 UTC (permalink / raw)
  To: will, joro, robin.murphy, robdclark
  Cc: linux-arm-msm, iommu, fanghao11, shenyang39

Fix the checkpatch errors in iommu module.

Zhiqi Song (3):
  drivers:iommu - coding style fix
  drivers:iommu/amd - coding style fix
  drivers:iommu/arm - coding style fix

 drivers/iommu/amd/init.c                    |  4 ++--
 drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c |  2 +-
 drivers/iommu/arm/arm-smmu/arm-smmu.c       |  6 +++---
 drivers/iommu/arm/arm-smmu/qcom_iommu.c     |  4 ++--
 drivers/iommu/io-pgtable-arm.c              | 16 ++++++++--------
 5 files changed, 16 insertions(+), 16 deletions(-)

--
2.7.4

_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/3] drivers: iommu - coding style fix
  2021-03-26  9:37 [PATCH 0/3] drivers: iommu coding style fix Zhiqi Song
@ 2021-03-26  9:37 ` Zhiqi Song
  2021-03-26  9:37 ` [PATCH 2/3] drivers: iommu/amd " Zhiqi Song
  2021-03-26  9:37 ` [PATCH 3/3] drivers: iommu/arm " Zhiqi Song
  2 siblings, 0 replies; 4+ messages in thread
From: Zhiqi Song @ 2021-03-26  9:37 UTC (permalink / raw)
  To: will, joro, robin.murphy, robdclark
  Cc: linux-arm-msm, iommu, fanghao11, shenyang39

Fixed following checkpatch error:
- space required after ','

Signed-off-by: Zhiqi Song <songzhiqi1@huawei.com>
---
 drivers/iommu/io-pgtable-arm.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/iommu/io-pgtable-arm.c b/drivers/iommu/io-pgtable-arm.c
index 87def58..3bf880f 100644
--- a/drivers/iommu/io-pgtable-arm.c
+++ b/drivers/iommu/io-pgtable-arm.c
@@ -37,7 +37,7 @@
  * Calculate the right shift amount to get to the portion describing level l
  * in a virtual address mapped by the pagetable in d.
  */
-#define ARM_LPAE_LVL_SHIFT(l,d)						\
+#define ARM_LPAE_LVL_SHIFT(l, d)					\
 	(((ARM_LPAE_MAX_LEVELS - (l)) * (d)->bits_per_level) +		\
 	ilog2(sizeof(arm_lpae_iopte)))

@@ -50,15 +50,15 @@
  * Calculate the index at level l used to map virtual address a using the
  * pagetable in d.
  */
-#define ARM_LPAE_PGD_IDX(l,d)						\
+#define ARM_LPAE_PGD_IDX(l, d)						\
 	((l) == (d)->start_level ? (d)->pgd_bits - (d)->bits_per_level : 0)

-#define ARM_LPAE_LVL_IDX(a,l,d)						\
-	(((u64)(a) >> ARM_LPAE_LVL_SHIFT(l,d)) &			\
-	 ((1 << ((d)->bits_per_level + ARM_LPAE_PGD_IDX(l,d))) - 1))
+#define ARM_LPAE_LVL_IDX(a, l, d)					\
+	(((u64)(a) >> ARM_LPAE_LVL_SHIFT(l, d)) &			\
+	 ((1 << ((d)->bits_per_level + ARM_LPAE_PGD_IDX(l, d))) - 1))

 /* Calculate the block/page mapping size at level l for pagetable in d. */
-#define ARM_LPAE_BLOCK_SIZE(l,d)	(1ULL << ARM_LPAE_LVL_SHIFT(l,d))
+#define ARM_LPAE_BLOCK_SIZE(l, d)	(1ULL << ARM_LPAE_LVL_SHIFT(l, d))

 /* Page table bits */
 #define ARM_LPAE_PTE_TYPE_SHIFT		0
@@ -68,7 +68,7 @@
 #define ARM_LPAE_PTE_TYPE_TABLE		3
 #define ARM_LPAE_PTE_TYPE_PAGE		3

-#define ARM_LPAE_PTE_ADDR_MASK		GENMASK_ULL(47,12)
+#define ARM_LPAE_PTE_ADDR_MASK		GENMASK_ULL(47, 12)

 #define ARM_LPAE_PTE_NSTABLE		(((arm_lpae_iopte)1) << 63)
 #define ARM_LPAE_PTE_XN			(((arm_lpae_iopte)3) << 53)
@@ -128,7 +128,7 @@
 #define ARM_MALI_LPAE_MEMATTR_WRITE_ALLOC 0x8DULL

 /* IOPTE accessors */
-#define iopte_deref(pte,d) __va(iopte_to_paddr(pte, d))
+#define iopte_deref(pte, d) __va(iopte_to_paddr(pte, d))

 #define iopte_type(pte)					\
 	(((pte) >> ARM_LPAE_PTE_TYPE_SHIFT) & ARM_LPAE_PTE_TYPE_MASK)
--
2.7.4

_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/3] drivers: iommu/amd - coding style fix
  2021-03-26  9:37 [PATCH 0/3] drivers: iommu coding style fix Zhiqi Song
  2021-03-26  9:37 ` [PATCH 1/3] drivers: iommu - " Zhiqi Song
@ 2021-03-26  9:37 ` Zhiqi Song
  2021-03-26  9:37 ` [PATCH 3/3] drivers: iommu/arm " Zhiqi Song
  2 siblings, 0 replies; 4+ messages in thread
From: Zhiqi Song @ 2021-03-26  9:37 UTC (permalink / raw)
  To: will, joro, robin.murphy, robdclark
  Cc: linux-arm-msm, iommu, fanghao11, shenyang39

Fixed following checkpatch errors:
- code indent should use tabs where possible
- space prohibited before ','

Signed-off-by: Zhiqi Song <songzhiqi1@huawei.com>
---
 drivers/iommu/amd/init.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/iommu/amd/init.c b/drivers/iommu/amd/init.c
index 6a1f704..958fa17 100644
--- a/drivers/iommu/amd/init.c
+++ b/drivers/iommu/amd/init.c
@@ -997,7 +997,7 @@ static bool copy_device_table(void)
 				return false;
 			}

-		        old_dev_tbl_cpy[devid].data[2] = old_devtb[devid].data[2];
+			old_dev_tbl_cpy[devid].data[2] = old_devtb[devid].data[2];
 		}
 	}
 	memunmap(old_devtb);
@@ -1248,7 +1248,7 @@ static int __init init_iommu_from_acpi(struct amd_iommu *iommu,

 			devid = e->devid;
 			devid_to = e->ext >> 8;
-			set_dev_entry_from_acpi(iommu, devid   , e->flags, 0);
+			set_dev_entry_from_acpi(iommu, devid, e->flags, 0);
 			set_dev_entry_from_acpi(iommu, devid_to, e->flags, 0);
 			amd_iommu_alias_table[devid] = devid_to;
 			break;
--
2.7.4

_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 3/3] drivers: iommu/arm - coding style fix
  2021-03-26  9:37 [PATCH 0/3] drivers: iommu coding style fix Zhiqi Song
  2021-03-26  9:37 ` [PATCH 1/3] drivers: iommu - " Zhiqi Song
  2021-03-26  9:37 ` [PATCH 2/3] drivers: iommu/amd " Zhiqi Song
@ 2021-03-26  9:37 ` Zhiqi Song
  2 siblings, 0 replies; 4+ messages in thread
From: Zhiqi Song @ 2021-03-26  9:37 UTC (permalink / raw)
  To: will, joro, robin.murphy, robdclark
  Cc: linux-arm-msm, iommu, fanghao11, shenyang39

Fixed following checkpatch error:
- spaces required around '='
- space required before the open parenthesis '('
- "foo * bar" should be "foo *bar"

Signed-off-by: Zhiqi Song <songzhiqi1@huawei.com>
---
 drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 2 +-
 drivers/iommu/arm/arm-smmu/arm-smmu.c       | 6 +++---
 drivers/iommu/arm/arm-smmu/qcom_iommu.c     | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
index 8ca7415..53e24f0 100644
--- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
+++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
@@ -2479,7 +2479,7 @@ static int arm_smmu_domain_set_attr(struct iommu_domain *domain,
 		}
 		break;
 	case IOMMU_DOMAIN_DMA:
-		switch(attr) {
+		switch (attr) {
 		case DOMAIN_ATTR_DMA_USE_FLUSH_QUEUE:
 			smmu_domain->non_strict = *(int *)data;
 			break;
diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu.c b/drivers/iommu/arm/arm-smmu/arm-smmu.c
index d8c6bfd..1496033 100644
--- a/drivers/iommu/arm/arm-smmu/arm-smmu.c
+++ b/drivers/iommu/arm/arm-smmu/arm-smmu.c
@@ -1261,7 +1261,7 @@ static phys_addr_t arm_smmu_iova_to_phys_hard(struct iommu_domain *domain,
 	struct arm_smmu_domain *smmu_domain = to_smmu_domain(domain);
 	struct arm_smmu_device *smmu = smmu_domain->smmu;
 	struct arm_smmu_cfg *cfg = &smmu_domain->cfg;
-	struct io_pgtable_ops *ops= smmu_domain->pgtbl_ops;
+	struct io_pgtable_ops *ops = smmu_domain->pgtbl_ops;
 	struct device *dev = smmu->dev;
 	void __iomem *reg;
 	u32 tmp;
@@ -1486,7 +1486,7 @@ static int arm_smmu_domain_get_attr(struct iommu_domain *domain,
 {
 	struct arm_smmu_domain *smmu_domain = to_smmu_domain(domain);

-	switch(domain->type) {
+	switch (domain->type) {
 	case IOMMU_DOMAIN_UNMANAGED:
 		switch (attr) {
 		case DOMAIN_ATTR_NESTING:
@@ -1527,7 +1527,7 @@ static int arm_smmu_domain_set_attr(struct iommu_domain *domain,

 	mutex_lock(&smmu_domain->init_mutex);

-	switch(domain->type) {
+	switch (domain->type) {
 	case IOMMU_DOMAIN_UNMANAGED:
 		switch (attr) {
 		case DOMAIN_ATTR_NESTING:
diff --git a/drivers/iommu/arm/arm-smmu/qcom_iommu.c b/drivers/iommu/arm/arm-smmu/qcom_iommu.c
index 7f280c8..f3985f3 100644
--- a/drivers/iommu/arm/arm-smmu/qcom_iommu.c
+++ b/drivers/iommu/arm/arm-smmu/qcom_iommu.c
@@ -81,7 +81,7 @@ static struct qcom_iommu_domain *to_qcom_iommu_domain(struct iommu_domain *dom)

 static const struct iommu_ops qcom_iommu_ops;

-static struct qcom_iommu_dev * to_iommu(struct device *dev)
+static struct qcom_iommu_dev *to_iommu(struct device *dev)
 {
 	struct iommu_fwspec *fwspec = dev_iommu_fwspec_get(dev);

@@ -91,7 +91,7 @@ static struct qcom_iommu_dev * to_iommu(struct device *dev)
 	return dev_iommu_priv_get(dev);
 }

-static struct qcom_iommu_ctx * to_ctx(struct qcom_iommu_domain *d, unsigned asid)
+static struct qcom_iommu_ctx *to_ctx(struct qcom_iommu_domain *d, unsigned asid)
 {
 	struct qcom_iommu_dev *qcom_iommu = d->iommu;
 	if (!qcom_iommu)
--
2.7.4

_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-03-26  9:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-26  9:37 [PATCH 0/3] drivers: iommu coding style fix Zhiqi Song
2021-03-26  9:37 ` [PATCH 1/3] drivers: iommu - " Zhiqi Song
2021-03-26  9:37 ` [PATCH 2/3] drivers: iommu/amd " Zhiqi Song
2021-03-26  9:37 ` [PATCH 3/3] drivers: iommu/arm " Zhiqi Song

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).