From 54b86289a383474685367a58ba69199ded39460a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ville=20Syrj=C3=A4l=C3=A4?= Date: Tue, 20 Mar 2012 16:46:14 +0200 Subject: [PATCH] drm: Use a flexible array member for blob property data MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The blob property data is always allocated immediately after the object header. No need for the extra indirection when accessing it, just use a flexible array member. Signed-off-by: Ville Syrjälä Reviewed-by: Alex Deucher Signed-off-by: Dave Airlie Signed-off-by: Kirill A. Shutemov --- drivers/gpu/drm/drm_crtc.c | 1 - include/drm/drm_crtc.h | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index 7a5b2ec..e1cd5ed 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c @@ -3218,7 +3218,6 @@ static struct drm_property_blob *drm_property_create_blob(struct drm_device *dev return NULL; } - blob->data = (void *)((char *)blob + sizeof(struct drm_property_blob)); blob->length = length; memcpy(blob->data, data, length); diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h index fa0ded1..28026e5 100644 --- a/include/drm/drm_crtc.h +++ b/include/drm/drm_crtc.h @@ -256,7 +256,7 @@ struct drm_property_blob { struct drm_mode_object base; struct list_head head; unsigned int length; - void *data; + unsigned char data[]; }; struct drm_property_enum { -- 2.7.4