aboutsummaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@s-opensource.com>2018-01-11 19:53:55 +0000
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2018-01-11 17:56:27 -0200
commit351eb68ac235f37f749a1c5d6ed2fae80e9dffe3 (patch)
treef7a74f1879983c020efe94ab2d687c434ed90c89 /contrib
parentd8b4c57e1d92ce0e8a2c76fdd2019c33662087f4 (diff)
mc_nextgen_test: get rid of casting warnings
In order to provide better compatibility with hybrid 32/64 bit systems, the logic for some pointers passed from/to kernel is to store on 64 bit integers. It generates, however, lots warnings when building on 32 bits. Fix them. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'contrib')
-rw-r--r--contrib/test/mc_nextgen_test.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/contrib/test/mc_nextgen_test.c b/contrib/test/mc_nextgen_test.c
index 5554d57e..50750e15 100644
--- a/contrib/test/mc_nextgen_test.c
+++ b/contrib/test/mc_nextgen_test.c
@@ -744,22 +744,22 @@ static int media_get_topology(struct media_controller *mc)
}
do {
- topo->ptr_entities = (__u64)calloc(topo->num_entities,
+ topo->ptr_entities = (uintptr_t)calloc(topo->num_entities,
sizeof(struct media_v2_entity));
if (topo->num_entities && !topo->ptr_entities)
goto error;
- topo->ptr_interfaces = (__u64)calloc(topo->num_interfaces,
+ topo->ptr_interfaces = (uintptr_t)calloc(topo->num_interfaces,
sizeof(struct media_v2_interface));
if (topo->num_interfaces && !topo->ptr_interfaces)
goto error;
- topo->ptr_pads = (__u64)calloc(topo->num_pads,
+ topo->ptr_pads = (uintptr_t)calloc(topo->num_pads,
sizeof(struct media_v2_pad));
if (topo->num_pads && !topo->ptr_pads)
goto error;
- topo->ptr_links = (__u64)calloc(topo->num_links,
+ topo->ptr_links = (uintptr_t)calloc(topo->num_links,
sizeof(struct media_v2_link));
if (topo->num_links && !topo->ptr_links)
goto error;
@@ -775,10 +775,10 @@ static int media_get_topology(struct media_controller *mc)
* topology changes should be rare, this
* should do the work
*/
- free((void *)topo->ptr_entities);
- free((void *)topo->ptr_interfaces);
- free((void *)topo->ptr_pads);
- free((void *)topo->ptr_links);
+ free(media_get_uptr(topo->ptr_entities));
+ free(media_get_uptr(topo->ptr_interfaces));
+ free(media_get_uptr(topo->ptr_pads));
+ free(media_get_uptr(topo->ptr_links));
topology_version = topo->topology_version;
continue;
}
@@ -793,13 +793,13 @@ static int media_get_topology(struct media_controller *mc)
error:
if (topo->ptr_entities)
- free((void *)topo->ptr_entities);
+ free(media_get_uptr(topo->ptr_entities));
if (topo->ptr_interfaces)
- free((void *)topo->ptr_interfaces);
+ free(media_get_uptr(topo->ptr_interfaces));
if (topo->ptr_pads)
- free((void *)topo->ptr_pads);
+ free(media_get_uptr(topo->ptr_pads));
if (topo->ptr_links)
- free((void *)topo->ptr_links);
+ free(media_get_uptr(topo->ptr_links));
topo->ptr_entities = 0;
topo->ptr_interfaces = 0;
@@ -833,13 +833,13 @@ static int mc_close(struct media_controller *mc)
if (mc->gobj)
free(mc->gobj);
if (mc->topo.ptr_entities)
- free((void *)mc->topo.ptr_entities);
+ free(media_get_uptr(mc->topo.ptr_entities));
if (mc->topo.ptr_interfaces)
- free((void *)mc->topo.ptr_interfaces);
+ free(media_get_uptr(mc->topo.ptr_interfaces));
if (mc->topo.ptr_pads)
- free((void *)mc->topo.ptr_pads);
+ free(media_get_uptr(mc->topo.ptr_pads));
if (mc->topo.ptr_links)
- free((void *)mc->topo.ptr_links);
+ free(media_get_uptr(mc->topo.ptr_links));
free(mc);
return ret;

Privacy Policy