diff options
author | ed <ed@FreeBSD.org> | 2012-09-15 19:28:54 +0000 |
---|---|---|
committer | ed <ed@FreeBSD.org> | 2012-09-15 19:28:54 +0000 |
commit | 123cfec6ca2eb9db492babac508ffbc4180f4bce (patch) | |
tree | f47c1b0dc13a34d8921acd832edeb41e48eb039b /sys/dev/drm2 | |
parent | 39bbd5cefa9f1b7dfff4748ae37d68c5b8342500 (diff) | |
download | FreeBSD-src-123cfec6ca2eb9db492babac508ffbc4180f4bce.zip FreeBSD-src-123cfec6ca2eb9db492babac508ffbc4180f4bce.tar.gz |
Prefer __containerof() above member2struct().
The first does proper checking of the argument types, while the latter
does not.
Diffstat (limited to 'sys/dev/drm2')
-rw-r--r-- | sys/dev/drm2/drm_gem.c | 2 | ||||
-rw-r--r-- | sys/dev/drm2/i915/i915_drv.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/drm2/drm_gem.c b/sys/dev/drm2/drm_gem.c index 3401de8..f2c3e08 100644 --- a/sys/dev/drm2/drm_gem.c +++ b/sys/dev/drm2/drm_gem.c @@ -396,7 +396,7 @@ drm_gem_object_from_offset(struct drm_device *dev, vm_ooffset_t offset) (uintmax_t)offset); return (NULL); } - obj = member2struct(drm_gem_object, map_list, map_list); + obj = __containerof(map_list, struct drm_gem_object, map_list); return (obj); } diff --git a/sys/dev/drm2/i915/i915_drv.h b/sys/dev/drm2/i915/i915_drv.h index 4c5acef..0e645cd 100644 --- a/sys/dev/drm2/i915/i915_drv.h +++ b/sys/dev/drm2/i915/i915_drv.h @@ -889,7 +889,7 @@ struct drm_i915_gem_object { int pending_flip; }; -#define to_intel_bo(x) member2struct(drm_i915_gem_object, base, (x)) +#define to_intel_bo(x) __containerof(x, struct drm_i915_gem_object, base) /** * Request queue structure. |