All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: dri-devel@lists.freedesktop.org
Cc: intel-gfx@lists.freedesktop.org
Subject: [PATCH 1/6] Revert "drm: Use a flexible array member for blob property data"
Date: Fri, 23 Feb 2018 21:25:01 +0200	[thread overview]
Message-ID: <20180223192506.29992-1-ville.syrjala@linux.intel.com> (raw)

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

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 d63f5e6bf6f2a1573ea39c9937cdf5ab0b3a4b77.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/drm_property.c | 1 +
 include/drm/drm_property.h     | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_property.c b/drivers/gpu/drm/drm_property.c
index bae50e6b819d..0f6620fea3de 100644
--- a/drivers/gpu/drm/drm_property.c
+++ b/drivers/gpu/drm/drm_property.c
@@ -550,6 +550,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;
 
diff --git a/include/drm/drm_property.h b/include/drm/drm_property.h
index 8a522b4bed40..265fd1f2e112 100644
--- a/include/drm/drm_property.h
+++ b/include/drm/drm_property.h
@@ -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 {
-- 
2.13.6

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

             reply	other threads:[~2018-02-23 19:25 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-23 19:25 Ville Syrjala [this message]
2018-02-23 19:25 ` [PATCH 2/6] drm: Remove now pointelss blob->data casts Ville Syrjala
2018-03-01  8:57   ` Sharma, Shashank
2018-02-23 19:25 ` [PATCH 3/6] drm: Verify gamma/degamma LUT size Ville Syrjala
2018-03-01 13:13   ` [Intel-gfx] " Sharma, Shashank
2018-03-01 13:24     ` Ville Syrjälä
2018-03-01 14:28       ` Sharma, Shashank
2018-03-01 14:35         ` [Intel-gfx] " Ville Syrjälä
2018-03-06  7:56   ` Daniel Vetter
2018-03-15 15:22   ` [PATCH v2 " Ville Syrjala
2018-02-23 19:25 ` [PATCH 4/6] drm: Introduce drm_color_lut_size() Ville Syrjala
2018-03-06  7:54   ` Daniel Vetter
2018-03-16 14:14     ` [Intel-gfx] " Ville Syrjälä
2018-03-15 15:23   ` [PATCH v2 " Ville Syrjala
2018-02-23 19:25 ` [PATCH 5/6] drm/i915: Remove the blob->data casts Ville Syrjala
2018-03-15 17:13   ` [PATCH v2 " Ville Syrjala
2018-02-23 19:25 ` [PATCH 6/6] drm/i915: Use drm_color_lut_size() Ville Syrjala
2018-02-23 19:55 ` ✓ Fi.CI.BAT: success for series starting with [1/6] Revert "drm: Use a flexible array member for blob property data" Patchwork
2018-02-23 20:38 ` ✓ Fi.CI.IGT: " Patchwork
2018-03-01  8:49 ` [PATCH 1/6] " Sharma, Shashank
2018-03-15 15:45 ` ✗ Fi.CI.BAT: failure for series starting with [1/6] Revert "drm: Use a flexible array member for blob property data" (rev3) Patchwork
2018-03-15 18:11 ` ✗ Fi.CI.BAT: failure for series starting with [1/6] Revert "drm: Use a flexible array member for blob property data" (rev4) Patchwork
2018-03-15 20:09 ` ✓ Fi.CI.BAT: success " Patchwork
2018-03-15 23:27 ` ✗ Fi.CI.IGT: failure " Patchwork
2018-03-16 10:33   ` Ville Syrjälä

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180223192506.29992-1-ville.syrjala@linux.intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.