Re: [PATCH v1 1/7] iommu/arm-smmu-v3: Move ctx_desc out of s1_cfg

From: Jason Gunthorpe
Date: Thu Jul 27 2023 - 14:45:42 EST


On Fri, Jul 28, 2023 at 02:26:17AM +0800, Michael Shavit wrote:
> @@ -715,25 +714,28 @@ enum arm_smmu_domain_stage {
> };
>
> struct arm_smmu_domain {
> - struct arm_smmu_device *smmu;
> - struct mutex init_mutex; /* Protects smmu pointer */
> + struct arm_smmu_device *smmu;
> + struct mutex init_mutex; /* Protects smmu pointer */
>
> - struct io_pgtable_ops *pgtbl_ops;
> - bool stall_enabled;
> - atomic_t nr_ats_masters;
> + struct io_pgtable_ops *pgtbl_ops;
> + bool stall_enabled;
> + atomic_t nr_ats_masters;
>
> - enum arm_smmu_domain_stage stage;
> + enum arm_smmu_domain_stage stage;
> union {
> - struct arm_smmu_s1_cfg s1_cfg;
> - struct arm_smmu_s2_cfg s2_cfg;
> + struct {
> + struct arm_smmu_ctx_desc cd;
> + struct arm_smmu_s1_cfg s1_cfg;
> + };
> + struct arm_smmu_s2_cfg s2_cfg;
> };
>
> - struct iommu_domain domain;
> + struct iommu_domain domain;
>
> - struct list_head devices;
> - spinlock_t devices_lock;
> + struct list_head devices;
> + spinlock_t devices_lock;
>
> - struct list_head mmu_notifiers;
> + struct list_head mmu_notifiers;
> };

Don't re-indent a whole struct just to get column alignment. Do
a few lines around where you are touching.

This is also why I quite dislike column alignment, aside from being
unreadable, it harms readability of diffs and increases maintenance
costs.

Jason