From: Ville Syrjälä Date: Tue, 13 Mar 2012 10:35:49 +0000 (+0200) Subject: drm: Use a flexible array member for blob property data X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=d63f5e6bf6f2a1573ea39c9937cdf5ab0b3a4b77;p=linux-beck.git drm: Use a flexible array member for blob property data 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 --- diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index f5b098e50bb1..d2d9dc52ac89 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c @@ -2943,7 +2943,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 00f4007a6d04..53cb49a13e17 100644 --- a/include/drm/drm_crtc.h +++ b/include/drm/drm_crtc.h @@ -257,7 +257,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 {