Skip to content

Commit

Permalink
Revert "drm: Use a flexible array member for blob property data"
Browse files Browse the repository at this point in the history
Using a flexible array for the blob data was a mistake by me. It
forces all users of the blob data to cast blob->data to something
else. void* is clearly superior so let's go back to the original
scheme.

Not a clean revert as the code has moved.

This reverts commit d63f5e6.

Signed-off-by: Ville Syrjälä <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Shashank Sharma <[email protected]>
Reviewed-by: Daniel Vetter <[email protected]>
  • Loading branch information
vsyrjala committed Mar 16, 2018
1 parent 0a00ac9 commit 9c60583
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions drivers/gpu/drm/drm_property.c
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,7 @@ drm_property_create_blob(struct drm_device *dev, size_t length,
/* This must be explicitly initialised, so we can safely call list_del
* on it in the removal handler, even if it isn't in a file list. */
INIT_LIST_HEAD(&blob->head_file);
blob->data = (void *)blob + sizeof(*blob);
blob->length = length;
blob->dev = dev;

Expand Down
2 changes: 1 addition & 1 deletion include/drm/drm_property.h
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ struct drm_property_blob {
struct list_head head_global;
struct list_head head_file;
size_t length;
unsigned char data[];
void *data;
};

struct drm_prop_enum_list {
Expand Down

0 comments on commit 9c60583

Please sign in to comment.