]> git.baikalelectronics.ru Git - kernel.git/commit
iommu: Use C99 flexible array in fwspec
authorRobin Murphy <robin.murphy@arm.com>
Thu, 13 Feb 2020 14:00:21 +0000 (14:00 +0000)
committerJoerg Roedel <jroedel@suse.de>
Fri, 28 Feb 2020 15:20:04 +0000 (16:20 +0100)
commit6b9a912c63c5ff337a1b5d184ddf214331f3af5e
treedd6ce19e19f9c1ae3de40cbbb4bb27fa003b015e
parent218d2ac1a4bfbb8ed3c4e9a719c4de27a9bf80db
iommu: Use C99 flexible array in fwspec

Although the 1-element array was a typical pre-C99 way to implement
variable-length structures, and indeed is a fundamental construct in the
APIs of certain other popular platforms, there's no good reason for it
here (and in particular the sizeof() trick is far too "clever" for its
own good). We can just as easily implement iommu_fwspec's preallocation
behaviour using a standard flexible array member, so let's make it look
the way most readers would expect.

Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/iommu.c
include/linux/iommu.h