]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
iommu/io-pgtable: Make io_pgtable_ops_to_pgtable() macro common
authorRobin Murphy <robin.murphy@arm.com>
Fri, 4 Dec 2015 17:53:01 +0000 (17:53 +0000)
committerWill Deacon <will.deacon@arm.com>
Thu, 17 Dec 2015 12:05:35 +0000 (12:05 +0000)
There is no need to keep a useful accessor for a public structure hidden
away in a private implementation. Move it out alongside the structure
definition so that other implementations may reuse it.

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
drivers/iommu/io-pgtable-arm.c
drivers/iommu/io-pgtable.h

index 7a5c772f7be2ad6786507e47671d5e4e06b72a24..937ba23e48d79681e3ed1e45313edb8da81a1603 100644 (file)
@@ -38,9 +38,6 @@
 #define io_pgtable_to_data(x)                                          \
        container_of((x), struct arm_lpae_io_pgtable, iop)
 
-#define io_pgtable_ops_to_pgtable(x)                                   \
-       container_of((x), struct io_pgtable, ops)
-
 #define io_pgtable_ops_to_data(x)                                      \
        io_pgtable_to_data(io_pgtable_ops_to_pgtable(x))
 
index 2e18469afe3c0c424ebd076b52aa284d49a0a5b8..36673c83de5816a4a0adca0acb30fd8c702bc4df 100644 (file)
@@ -131,6 +131,8 @@ struct io_pgtable {
        struct io_pgtable_ops   ops;
 };
 
+#define io_pgtable_ops_to_pgtable(x) container_of((x), struct io_pgtable, ops)
+
 /**
  * struct io_pgtable_init_fns - Alloc/free a set of page tables for a
  *                              particular format.