drm: Use size_t for blob property sizes
Subsystems (2)
PATCH 1/2 drm: Use size_t for blob property sizes
From: Thierry Reding <[email protected]>
size_t is the standard type when dealing with sizes of all kinds. Use it consistently when instantiating DRM blob properties.
Signed-off-by Thierry Reding <[email protected]>
--- drivers/gpu/drm/drm_crtc.c | 8 +++++--- include/drm/drm_crtc.h | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-)
drivers/gpu/drm/drm_crtc.c +5 -3
@@ -3538,8 +3538,9 @@ done:return ret; } -static struct drm_property_blob *drm_property_create_blob (struct drm_device *dev,int length, -void *data) +static struct drm_property_blob * +drm_property_create_blob (struct drm_device *dev,size_t length, +void *data) {struct drm_property_blob *blob;int ret;
@@ -3636,7 +3637,8 @@ int drm_mode_connector_update_edid_property(struct drm_connector *connector, struct edid *edid) {struct drm_device *dev = connector->dev; -int ret, size; +size_t size; +int ret;if (connector->edid_blob_ptr)drm_property_destroy_blob (dev, connector->edid_blob_ptr);
include/drm/drm_crtc.h +1 -1
@@ -173,7 +173,7 @@ struct drm_framebuffer {struct drm_property_blob {struct drm_mode_object base;struct list_head head; -unsigned int length; +size_t length;unsigned char data[]; };
Signature · 1 line
1.9.2
PATCH 2/2 drm: Use const data when creating blob properties
From: Thierry Reding <[email protected]>
Creating a blob property will always copy the input data so the data that is passed in can be const.
Signed-off-by Thierry Reding <[email protected]>
--- drivers/gpu/drm/drm_crtc.c | 4 ++-- include/drm/drm_crtc.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/drm_crtc.c +2 -2
@@ -3540,7 +3540,7 @@ done:static struct drm_property_blob *drm_property_create_blob (struct drm_device *dev,size_t length, -void *data) +const void *data) {struct drm_property_blob *blob;int ret;
@@ -3634,7 +3634,7 @@ done:* Zero on success, errno on failure. */ int drm_mode_connector_update_edid_property (struct drm_connector *connector, -struct edid *edid) +const struct edid *edid) {struct drm_device *dev = connector->dev;size_t size;
include/drm/drm_crtc.h +1 -1
@@ -925,7 +925,7 @@ extern void drm_mode_config_reset(struct drm_device *dev);extern void drm_mode_config_cleanup (struct drm_device *dev);extern int drm_mode_connector_update_edid_property (struct drm_connector *connector, -struct edid *edid); +const struct edid *edid);extern int drm_object_property_set_value (struct drm_mode_object *obj,struct drm_property *property,uint64_t val);
Signature · 1 line
1.9.2