drm/qxl: use container_of to resolve qxl_fbdev from drm_fb_helper
authorFabian Frederick <fabf@skynet.be>
Sun, 14 Sep 2014 16:40:19 +0000 (18:40 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 24 Sep 2014 10:09:26 +0000 (12:09 +0200)
Use container_of instead of casting first structure member.

Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/qxl/qxl_fb.c

index df567888bb1e3e04ef73b3b3f38a8a9e75e1fc5d..3d7c1d00a424cfbdbdf53881421f2f4e193f247e 100644 (file)
@@ -625,7 +625,8 @@ static int qxl_fb_find_or_create_single(
                struct drm_fb_helper *helper,
                struct drm_fb_helper_surface_size *sizes)
 {
-       struct qxl_fbdev *qfbdev = (struct qxl_fbdev *)helper;
+       struct qxl_fbdev *qfbdev =
+               container_of(helper, struct qxl_fbdev, helper);
        int new_fb = 0;
        int ret;