]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
iommu/arm-smmu: Tidy up context bank indexing
authorRobin Murphy <robin.murphy@arm.com>
Thu, 30 Mar 2017 16:56:30 +0000 (17:56 +0100)
committerWill Deacon <will.deacon@arm.com>
Thu, 6 Apr 2017 15:06:43 +0000 (16:06 +0100)
commit452107c79035c6654b963e83c4862d9faa195af4
tree0370a501b31ddb7bb3b2e07949c84789ab87ac0d
parent280b683ceaceb7508dc1e9c7e148ea1dcdf36543
iommu/arm-smmu: Tidy up context bank indexing

ARM_AMMU_CB() is calculated relative to ARM_SMMU_CB_BASE(), but the
latter is never of use on its own, and what we end up with is the same
ARM_SMMU_CB_BASE() + ARM_AMMU_CB() expression being duplicated at every
callsite. Folding the two together gives us a self-contained context
bank accessor which is much more pleasant to work with.

Secondly, we might as well simplify CB_BASE itself at the same time.
We use the address space size for its own sake precisely once, at probe
time, and every other usage is to dynamically calculate CB_BASE over
and over and over again. Let's flip things around so that we just
maintain the CB_BASE address directly.

Reviewed-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
drivers/iommu/arm-smmu.c