]> git.baikalelectronics.ru Git - kernel.git/commit
iommu/arm-smmu-v3: Clean up register definitions
authorRobin Murphy <robin.murphy@arm.com>
Mon, 26 Mar 2018 12:35:10 +0000 (13:35 +0100)
committerWill Deacon <will.deacon@arm.com>
Tue, 27 Mar 2018 13:12:04 +0000 (14:12 +0100)
commit04213d0062932a163600734854321ad7d8b7b4ab
tree3246add944192377c35ec3f4fd5f3c8dc11b85d2
parent9608d572c70c89d5a6f21f4745277819ec054786
iommu/arm-smmu-v3: Clean up register definitions

The FIELD_{GET,PREP} accessors provided by linux/bitfield.h allow us to
define multi-bit register fields solely in terms of their bit positions
via GENMASK(), without needing explicit *_SHIFT and *_MASK definitions.
As well as the immediate reduction in lines of code, this avoids the
awkwardness of values sometimes being pre-shifted and sometimes not,
which means we can factor out some common values like memory attributes.
Furthermore, it also makes it trivial to verify the definitions against
the architecture spec, on which note let's also fix up a few field names
to properly match the current release (IHI0070B).

Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
drivers/iommu/arm-smmu-v3.c