Bläddra i källkod

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ä <ville.syrjala@linux.intel.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Ville Syrjälä 13 år sedan
förälder
incheckning
d63f5e6bf6
2 ändrade filer med 1 tillägg och 2 borttagningar
  1. 0 1
      drivers/gpu/drm/drm_crtc.c
  2. 1 1
      include/drm/drm_crtc.h

+ 0 - 1
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);

+ 1 - 1
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 {