[Mesa-dev] [PATCH 10/15] winsys/virgl: remove calloc/malloc casts

Emil Velikov emil.l.velikov at gmail.com
Thu Oct 29 04:59:41 PDT 2015


Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
---
 src/gallium/winsys/virgl/drm/virgl_drm_winsys.c     | 5 ++---
 src/gallium/winsys/virgl/vtest/virgl_vtest_winsys.c | 3 +--
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/src/gallium/winsys/virgl/drm/virgl_drm_winsys.c b/src/gallium/winsys/virgl/drm/virgl_drm_winsys.c
index 31317b9..8a74c40 100644
--- a/src/gallium/winsys/virgl/drm/virgl_drm_winsys.c
+++ b/src/gallium/winsys/virgl/drm/virgl_drm_winsys.c
@@ -513,13 +513,12 @@ static struct virgl_cmd_buf *virgl_drm_cmd_buf_create(struct virgl_winsys *qws)
    cbuf->ws = qws;
 
    cbuf->nres = 512;
-   cbuf->res_bo = (struct virgl_hw_res **)
-      CALLOC(cbuf->nres, sizeof(struct virgl_hw_buf*));
+   cbuf->res_bo = CALLOC(cbuf->nres, sizeof(struct virgl_hw_buf*));
    if (!cbuf->res_bo) {
       FREE(cbuf);
       return NULL;
    }
-   cbuf->res_hlist = (uint32_t *)malloc(cbuf->nres * sizeof(uint32_t));
+   cbuf->res_hlist = malloc(cbuf->nres * sizeof(uint32_t));
    if (!cbuf->res_hlist) {
       FREE(cbuf->res_bo);
       FREE(cbuf);
diff --git a/src/gallium/winsys/virgl/vtest/virgl_vtest_winsys.c b/src/gallium/winsys/virgl/vtest/virgl_vtest_winsys.c
index 1c8df6e..28c4c62 100644
--- a/src/gallium/winsys/virgl/vtest/virgl_vtest_winsys.c
+++ b/src/gallium/winsys/virgl/vtest/virgl_vtest_winsys.c
@@ -394,8 +394,7 @@ static struct virgl_cmd_buf *virgl_vtest_cmd_buf_create(struct virgl_winsys *vws
       return NULL;
 
    cbuf->nres = 512;
-   cbuf->res_bo = (struct virgl_hw_res **)
-      CALLOC(cbuf->nres, sizeof(struct virgl_hw_buf*));
+   cbuf->res_bo = CALLOC(cbuf->nres, sizeof(struct virgl_hw_buf*));
    if (!cbuf->res_bo) {
       FREE(cbuf);
       return NULL;
-- 
2.6.2



More information about the mesa-dev mailing list