tree: Remove void * casts
void * can be assigned from and stored to any pointer type without any warning. Remove the explicit casts. Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
This commit is contained in:
+6
-12
@@ -44,8 +44,7 @@ VAStatus RequestCreateBuffer(VADriverContextP context, VAContextID context_id,
|
||||
unsigned int count, void *data,
|
||||
VABufferID *buffer_id)
|
||||
{
|
||||
struct request_data *driver_data =
|
||||
(struct request_data *)context->pDriverData;
|
||||
struct request_data *driver_data = context->pDriverData;
|
||||
struct object_buffer *buffer_object = NULL;
|
||||
void *buffer_data;
|
||||
VAStatus status;
|
||||
@@ -102,8 +101,7 @@ complete:
|
||||
|
||||
VAStatus RequestDestroyBuffer(VADriverContextP context, VABufferID buffer_id)
|
||||
{
|
||||
struct request_data *driver_data =
|
||||
(struct request_data *)context->pDriverData;
|
||||
struct request_data *driver_data = context->pDriverData;
|
||||
struct object_buffer *buffer_object;
|
||||
|
||||
buffer_object = BUFFER(driver_data, buffer_id);
|
||||
@@ -122,8 +120,7 @@ VAStatus RequestDestroyBuffer(VADriverContextP context, VABufferID buffer_id)
|
||||
VAStatus RequestMapBuffer(VADriverContextP context, VABufferID buffer_id,
|
||||
void **data_map)
|
||||
{
|
||||
struct request_data *driver_data =
|
||||
(struct request_data *)context->pDriverData;
|
||||
struct request_data *driver_data = context->pDriverData;
|
||||
struct object_buffer *buffer_object;
|
||||
|
||||
buffer_object = BUFFER(driver_data, buffer_id);
|
||||
@@ -138,8 +135,7 @@ VAStatus RequestMapBuffer(VADriverContextP context, VABufferID buffer_id,
|
||||
|
||||
VAStatus RequestUnmapBuffer(VADriverContextP context, VABufferID buffer_id)
|
||||
{
|
||||
struct request_data *driver_data =
|
||||
(struct request_data *)context->pDriverData;
|
||||
struct request_data *driver_data = context->pDriverData;
|
||||
struct object_buffer *buffer_object;
|
||||
|
||||
buffer_object = BUFFER(driver_data, buffer_id);
|
||||
@@ -154,8 +150,7 @@ VAStatus RequestUnmapBuffer(VADriverContextP context, VABufferID buffer_id)
|
||||
VAStatus RequestBufferSetNumElements(VADriverContextP context,
|
||||
VABufferID buffer_id, unsigned int count)
|
||||
{
|
||||
struct request_data *driver_data =
|
||||
(struct request_data *)context->pDriverData;
|
||||
struct request_data *driver_data = context->pDriverData;
|
||||
struct object_buffer *buffer_object;
|
||||
|
||||
buffer_object = BUFFER(driver_data, buffer_id);
|
||||
@@ -174,8 +169,7 @@ VAStatus RequestBufferInfo(VADriverContextP context, VABufferID buffer_id,
|
||||
VABufferType *type, unsigned int *size,
|
||||
unsigned int *count)
|
||||
{
|
||||
struct request_data *driver_data =
|
||||
(struct request_data *)context->pDriverData;
|
||||
struct request_data *driver_data = context->pDriverData;
|
||||
struct object_buffer *buffer_object;
|
||||
|
||||
buffer_object = BUFFER(driver_data, buffer_id);
|
||||
|
||||
+4
-8
@@ -41,8 +41,7 @@ VAStatus RequestCreateConfig(VADriverContextP context, VAProfile profile,
|
||||
VAConfigAttrib *attributes, int attributes_count,
|
||||
VAConfigID *config_id)
|
||||
{
|
||||
struct request_data *driver_data =
|
||||
(struct request_data *)context->pDriverData;
|
||||
struct request_data *driver_data = context->pDriverData;
|
||||
struct object_config *config_object;
|
||||
VAConfigID id;
|
||||
int i, index;
|
||||
@@ -91,8 +90,7 @@ VAStatus RequestCreateConfig(VADriverContextP context, VAProfile profile,
|
||||
|
||||
VAStatus RequestDestroyConfig(VADriverContextP context, VAConfigID config_id)
|
||||
{
|
||||
struct request_data *driver_data =
|
||||
(struct request_data *)context->pDriverData;
|
||||
struct request_data *driver_data = context->pDriverData;
|
||||
struct object_config *config_object;
|
||||
|
||||
config_object = CONFIG(driver_data, config_id);
|
||||
@@ -108,8 +106,7 @@ VAStatus RequestDestroyConfig(VADriverContextP context, VAConfigID config_id)
|
||||
VAStatus RequestQueryConfigProfiles(VADriverContextP context,
|
||||
VAProfile *profiles, int *profiles_count)
|
||||
{
|
||||
struct request_data *driver_data =
|
||||
(struct request_data *)context->pDriverData;
|
||||
struct request_data *driver_data = context->pDriverData;
|
||||
unsigned int index = 0;
|
||||
bool found;
|
||||
|
||||
@@ -168,8 +165,7 @@ VAStatus RequestQueryConfigAttributes(VADriverContextP context,
|
||||
VAConfigAttrib *attributes,
|
||||
int *attributes_count)
|
||||
{
|
||||
struct request_data *driver_data =
|
||||
(struct request_data *)context->pDriverData;
|
||||
struct request_data *driver_data = context->pDriverData;
|
||||
struct object_config *config_object;
|
||||
int i;
|
||||
|
||||
|
||||
+2
-4
@@ -46,8 +46,7 @@ VAStatus RequestCreateContext(VADriverContextP context, VAConfigID config_id,
|
||||
VASurfaceID *surfaces_ids, int surfaces_count,
|
||||
VAContextID *context_id)
|
||||
{
|
||||
struct request_data *driver_data =
|
||||
(struct request_data *)context->pDriverData;
|
||||
struct request_data *driver_data = context->pDriverData;
|
||||
struct object_config *config_object;
|
||||
struct object_surface *surface_object;
|
||||
struct object_context *context_object = NULL;
|
||||
@@ -195,8 +194,7 @@ complete:
|
||||
|
||||
VAStatus RequestDestroyContext(VADriverContextP context, VAContextID context_id)
|
||||
{
|
||||
struct request_data *driver_data =
|
||||
(struct request_data *)context->pDriverData;
|
||||
struct request_data *driver_data = context->pDriverData;
|
||||
struct object_context *context_object;
|
||||
int rc;
|
||||
|
||||
|
||||
+3
-6
@@ -38,8 +38,7 @@
|
||||
VAStatus RequestCreateImage(VADriverContextP context, VAImageFormat *format,
|
||||
int width, int height, VAImage *image)
|
||||
{
|
||||
struct request_data *driver_data =
|
||||
(struct request_data *)context->pDriverData;
|
||||
struct request_data *driver_data = context->pDriverData;
|
||||
unsigned int destination_sizes[VIDEO_MAX_PLANES];
|
||||
unsigned int destination_bytesperlines[VIDEO_MAX_PLANES];
|
||||
unsigned int destination_planes_count;
|
||||
@@ -99,8 +98,7 @@ VAStatus RequestCreateImage(VADriverContextP context, VAImageFormat *format,
|
||||
|
||||
VAStatus RequestDestroyImage(VADriverContextP context, VAImageID image_id)
|
||||
{
|
||||
struct request_data *driver_data =
|
||||
(struct request_data *)context->pDriverData;
|
||||
struct request_data *driver_data = context->pDriverData;
|
||||
struct object_image *image_object;
|
||||
VAStatus status;
|
||||
|
||||
@@ -121,8 +119,7 @@ VAStatus RequestDestroyImage(VADriverContextP context, VAImageID image_id)
|
||||
VAStatus RequestDeriveImage(VADriverContextP context, VASurfaceID surface_id,
|
||||
VAImage *image)
|
||||
{
|
||||
struct request_data *driver_data =
|
||||
(struct request_data *)context->pDriverData;
|
||||
struct request_data *driver_data = context->pDriverData;
|
||||
struct object_surface *surface_object;
|
||||
struct object_buffer *buffer_object;
|
||||
unsigned int i;
|
||||
|
||||
+3
-6
@@ -166,8 +166,7 @@ static VAStatus codec_set_controls(struct request_data *driver_data,
|
||||
VAStatus RequestBeginPicture(VADriverContextP context, VAContextID context_id,
|
||||
VASurfaceID surface_id)
|
||||
{
|
||||
struct request_data *driver_data =
|
||||
(struct request_data *)context->pDriverData;
|
||||
struct request_data *driver_data = context->pDriverData;
|
||||
struct object_context *context_object;
|
||||
struct object_surface *surface_object;
|
||||
|
||||
@@ -191,8 +190,7 @@ VAStatus RequestBeginPicture(VADriverContextP context, VAContextID context_id,
|
||||
VAStatus RequestRenderPicture(VADriverContextP context, VAContextID context_id,
|
||||
VABufferID *buffers_ids, int buffers_count)
|
||||
{
|
||||
struct request_data *driver_data =
|
||||
(struct request_data *)context->pDriverData;
|
||||
struct request_data *driver_data = context->pDriverData;
|
||||
struct object_context *context_object;
|
||||
struct object_config *config_object;
|
||||
struct object_surface *surface_object;
|
||||
@@ -229,8 +227,7 @@ VAStatus RequestRenderPicture(VADriverContextP context, VAContextID context_id,
|
||||
|
||||
VAStatus RequestEndPicture(VADriverContextP context, VAContextID context_id)
|
||||
{
|
||||
struct request_data *driver_data =
|
||||
(struct request_data *)context->pDriverData;
|
||||
struct request_data *driver_data = context->pDriverData;
|
||||
struct object_context *context_object;
|
||||
struct object_config *config_object;
|
||||
struct object_surface *surface_object;
|
||||
|
||||
+2
-3
@@ -125,7 +125,7 @@ VAStatus VA_DRIVER_INIT_FUNC(VADriverContextP context)
|
||||
driver_data = malloc(sizeof(*driver_data));
|
||||
memset(driver_data, 0, sizeof(*driver_data));
|
||||
|
||||
context->pDriverData = (void *)driver_data;
|
||||
context->pDriverData = driver_data;
|
||||
|
||||
object_heap_init(&driver_data->config_heap,
|
||||
sizeof(struct object_config), CONFIG_ID_OFFSET);
|
||||
@@ -183,8 +183,7 @@ complete:
|
||||
|
||||
VAStatus RequestTerminate(VADriverContextP context)
|
||||
{
|
||||
struct request_data *driver_data =
|
||||
(struct request_data *)context->pDriverData;
|
||||
struct request_data *driver_data = context->pDriverData;
|
||||
struct object_buffer *buffer_object;
|
||||
struct object_image *image_object;
|
||||
struct object_surface *surface_object;
|
||||
|
||||
+5
-9
@@ -46,8 +46,7 @@ VAStatus RequestCreateSurfaces(VADriverContextP context, int width, int height,
|
||||
int format, int surfaces_count,
|
||||
VASurfaceID *surfaces_ids)
|
||||
{
|
||||
struct request_data *driver_data =
|
||||
(struct request_data *)context->pDriverData;
|
||||
struct request_data *driver_data = context->pDriverData;
|
||||
struct object_surface *surface_object;
|
||||
struct video_format *video_format;
|
||||
unsigned int destination_sizes[VIDEO_MAX_PLANES];
|
||||
@@ -123,7 +122,7 @@ VAStatus RequestCreateSurfaces(VADriverContextP context, int width, int height,
|
||||
surface_object->destination_offsets[j] =
|
||||
j > 0 ? destination_sizes[j - 1] : 0;
|
||||
surface_object->destination_data[j] =
|
||||
(void *)((unsigned char *)surface_object->destination_map[0] +
|
||||
((unsigned char *)surface_object->destination_map[0] +
|
||||
surface_object->destination_offsets[j]);
|
||||
surface_object->destination_sizes[j] =
|
||||
destination_sizes[j];
|
||||
@@ -175,8 +174,7 @@ VAStatus RequestCreateSurfaces(VADriverContextP context, int width, int height,
|
||||
VAStatus RequestDestroySurfaces(VADriverContextP context,
|
||||
VASurfaceID *surfaces_ids, int surfaces_count)
|
||||
{
|
||||
struct request_data *driver_data =
|
||||
(struct request_data *)context->pDriverData;
|
||||
struct request_data *driver_data = context->pDriverData;
|
||||
struct object_surface *surface_object;
|
||||
unsigned int i, j;
|
||||
|
||||
@@ -211,8 +209,7 @@ VAStatus RequestDestroySurfaces(VADriverContextP context,
|
||||
|
||||
VAStatus RequestSyncSurface(VADriverContextP context, VASurfaceID surface_id)
|
||||
{
|
||||
struct request_data *driver_data =
|
||||
(struct request_data *)context->pDriverData;
|
||||
struct request_data *driver_data = context->pDriverData;
|
||||
struct object_surface *surface_object;
|
||||
VAStatus status;
|
||||
int request_fd = -1;
|
||||
@@ -289,8 +286,7 @@ VAStatus RequestQuerySurfaceStatus(VADriverContextP context,
|
||||
VASurfaceID surface_id,
|
||||
VASurfaceStatus *status)
|
||||
{
|
||||
struct request_data *driver_data =
|
||||
(struct request_data *)context->pDriverData;
|
||||
struct request_data *driver_data = context->pDriverData;
|
||||
struct object_surface *surface_object;
|
||||
|
||||
surface_object = SURFACE(driver_data, surface_id);
|
||||
|
||||
Reference in New Issue
Block a user