Skip to content

Commit

Permalink
drm: Use a flexible array member for blob property data
Browse files Browse the repository at this point in the history
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ä <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
Signed-off-by: Dave Airlie <[email protected]>
  • Loading branch information
vsyrjala authored and airlied committed Mar 15, 2012
1 parent 6bfc56a commit d63f5e6
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion drivers/gpu/drm/drm_crtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion include/drm/drm_crtc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit d63f5e6

Please sign in to comment.