[PATCH RFC 092/111] staging: etnaviv: convert to_etnaviv_bo() to real function

Lucas Stach l.stach at pengutronix.de
Thu Apr 2 08:30:34 PDT 2015


This provides a bit more type safety.

Signed-off-by: Lucas Stach <l.stach at pengutronix.de>
---
 drivers/staging/etnaviv/etnaviv_gem.h | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/etnaviv/etnaviv_gem.h b/drivers/staging/etnaviv/etnaviv_gem.h
index cfade337d4db..fadd5198b3e8 100644
--- a/drivers/staging/etnaviv/etnaviv_gem.h
+++ b/drivers/staging/etnaviv/etnaviv_gem.h
@@ -75,7 +75,12 @@ struct etnaviv_gem_object {
 
 	struct etnaviv_gem_userptr userptr;
 };
-#define to_etnaviv_bo(x) container_of(x, struct etnaviv_gem_object, base)
+
+static inline
+struct etnaviv_gem_object *to_etnaviv_bo(struct drm_gem_object *obj)
+{
+	return container_of(obj, struct etnaviv_gem_object, base);
+}
 
 struct etnaviv_gem_ops {
 	int (*get_pages)(struct etnaviv_gem_object *);
-- 
2.1.4



More information about the dri-devel mailing list