diff options
author | Hoegeun Kwon <hoegeun.kwon@samsung.com> | 2017-04-18 14:17:15 +0900 |
---|---|---|
committer | Hoegeun Kwon <hoegeun.kwon@samsung.com> | 2017-04-18 14:20:56 +0900 |
commit | 2380ed1c9a31bde6015219091cbb5463a44ba215 (patch) | |
tree | 861a511973a8f80f45d5610fdeccc155cf36f5ce /tests/ipptest | |
parent | 1010a2b8163d7d495a343c0acd52cc1ede837ae6 (diff) | |
download | libdrm-2380ed1c9a31bde6015219091cbb5463a44ba215.tar.gz libdrm-2380ed1c9a31bde6015219091cbb5463a44ba215.tar.bz2 libdrm-2380ed1c9a31bde6015219091cbb5463a44ba215.zip |
ipptest: Remove strerror()tizen_4.0.m1_releasesubmit/tizen/20170418.065107accepted/tizen/unified/20170419.054145
To remove warning of static analysis tool, this removes strerror().
Change-Id: I132cf0271ac9a1641c1c88611aca5c3f311240a7
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
Diffstat (limited to 'tests/ipptest')
-rw-r--r-- | tests/ipptest/fimc.c | 45 | ||||
-rw-r--r-- | tests/ipptest/fimctest.c | 31 | ||||
-rw-r--r-- | tests/ipptest/gem.c | 18 | ||||
-rw-r--r-- | tests/ipptest/util.c | 9 |
4 files changed, 47 insertions, 56 deletions
diff --git a/tests/ipptest/fimc.c b/tests/ipptest/fimc.c index c18986d9..037b5202 100644 --- a/tests/ipptest/fimc.c +++ b/tests/ipptest/fimc.c @@ -108,8 +108,7 @@ struct resources *get_resources(struct device *dev) res->res = drmModeGetResources(dev->fd); if (!res->res) { - fprintf(stderr, "drmModeGetResources failed: %s\n", - strerror(errno)); + fprintf(stderr, "drmModeGetResources failed: %d\n", errno); goto error; } @@ -133,9 +132,9 @@ struct resources *get_resources(struct device *dev) (_res)->type##s[i].type = \ drmModeGet##Type(dev->fd, (_res)->__res->type##s[i]); \ if (!(_res)->type##s[i].type) \ - fprintf(stderr, "could not get %s %i: %s\n", \ + fprintf(stderr, "could not get %s %i: %d\n", \ #type, (_res)->__res->type##s[i], \ - strerror(errno)); \ + errno); \ } \ } while (0) @@ -155,9 +154,9 @@ struct resources *get_resources(struct device *dev) DRM_MODE_OBJECT_##Type); \ if (!obj->props) { \ fprintf(stderr, \ - "could not get %s %i properties: %s\n", \ + "could not get %s %i properties: %d\n", \ #type, obj->type->type##_id, \ - strerror(errno)); \ + errno); \ continue; \ } \ obj->props_info = malloc(obj->props->count_props * \ @@ -185,9 +184,9 @@ struct resources *get_resources(struct device *dev) DRM_MODE_OBJECT_CONNECTOR); if (!obj->props) { - fprintf(stderr, "could not get %s %u properties: %s\n", + fprintf(stderr, "could not get %s %u properties: %d\n", "drm_connector", obj->connector->connector_id, - strerror(errno)); + errno); continue; } @@ -208,8 +207,7 @@ struct resources *get_resources(struct device *dev) res->plane_res = drmModeGetPlaneResources(dev->fd); if (!res->plane_res) { - fprintf(stderr, "drmModeGetPlaneResources failed: %s\n", - strerror(errno)); + fprintf(stderr, "drmModeGetPlaneResources failed: %d\n", errno); return res; } @@ -507,8 +505,8 @@ static int exynos_drm_ipp_set_property(int fd, ret = ioctl(fd, DRM_IOCTL_EXYNOS_IPP_SET_PROPERTY, property); if (ret) fprintf(stderr, - "failed to DRM_IOCTL_EXYNOS_IPP_SET_PROPERTY : %s\n", - strerror(errno)); + "failed to DRM_IOCTL_EXYNOS_IPP_SET_PROPERTY : %d\n", + errno); printf("DRM_IOCTL_EXYNOS_IPP_SET_PROPERTY : prop_id[%d]\n", property->prop_id); @@ -541,8 +539,8 @@ static int exynos_drm_ipp_queue_buf(int fd, struct drm_exynos_ipp_queue_buf *qbu ret = ioctl(fd, DRM_IOCTL_EXYNOS_IPP_QUEUE_BUF, qbuf); if (ret) fprintf(stderr, - "failed to DRM_IOCTL_EXYNOS_IPP_QUEUE_BUF[id:%d][buf_type:%d] : %s\n", - ops_id, buf_type, strerror(errno)); + "failed to DRM_IOCTL_EXYNOS_IPP_QUEUE_BUF[id:%d][buf_type:%d] : %d\n", + ops_id, buf_type, errno); return ret; } @@ -561,8 +559,8 @@ static int exynos_drm_ipp_cmd_ctrl(int fd, struct drm_exynos_ipp_cmd_ctrl *cmd_c ret = ioctl(fd, DRM_IOCTL_EXYNOS_IPP_CMD_CTRL, cmd_ctrl); if (ret) fprintf(stderr, - "failed to DRM_IOCTL_EXYNOS_IPP_CMD_CTRL[prop_id:%d][ctrl:%d] : %s\n", - prop_id, ctrl, strerror(errno)); + "failed to DRM_IOCTL_EXYNOS_IPP_CMD_CTRL[prop_id:%d][ctrl:%d] : %d\n", + prop_id, ctrl, errno); return ret; } @@ -833,9 +831,9 @@ void fimc_m2m_set_mode(struct device *dev, struct connector *c, int count, pipe.fourcc, handles, pitches, offsets, &fb_id_dst, 0); if (ret) { - fprintf(stderr, "failed to add fb (%ux%u):%s\n", + fprintf(stderr, "failed to add fb (%ux%u):%d\n", dev->mode.width, dev->mode.height, - strerror(errno)); + errno); goto err_ipp_quque_close; } @@ -844,8 +842,7 @@ void fimc_m2m_set_mode(struct device *dev, struct connector *c, int count, fb_id_dst, 0, 0, pipe.con_ids, pipe.num_cons, pipe.mode); if (ret) { - fprintf(stderr, "failed to set crtc: %s\n", - strerror(errno)); + fprintf(stderr, "failed to set crtc: %d\n", errno); goto err_ipp_quque_close; } @@ -870,8 +867,8 @@ void fimc_m2m_set_mode(struct device *dev, struct connector *c, int count, fb_id_dst, DRM_MODE_PAGE_FLIP_EVENT, &pipe); if (ret) { - fprintf(stderr, "failed to page flip: %s\n", - strerror(errno)); + fprintf(stderr, "failed to page flip: %d\n", + errno); goto err_ipp_quque_close; } @@ -999,8 +996,8 @@ void fimc_wb_set_mode(struct connector *c, int count, int page_flip, for (i = 0; i < MAX_BUF; i++) { ret = util_gem_create_mmap(fd, &gem[i], &mmap[i], stride * height); if (ret) { - fprintf(stderr, "failed to gem create mmap: %s\n", - strerror(errno)); + fprintf(stderr, "failed to gem create mmap: %d\n", + errno); if (ret == -1) return; else if (ret == -2) goto err_ipp_ctrl_close; } diff --git a/tests/ipptest/fimctest.c b/tests/ipptest/fimctest.c index 196f3c4b..09c8b676 100644 --- a/tests/ipptest/fimctest.c +++ b/tests/ipptest/fimctest.c @@ -123,8 +123,8 @@ static void dump_encoders(void) encoder = drmModeGetEncoder(fd, resources->encoders[i]); if (!encoder) { - fprintf(stderr, "could not get encoder %i: %s\n", - resources->encoders[i], strerror(errno)); + fprintf(stderr, "could not get encoder %i: %d\n", + resources->encoders[i], errno); continue; } printf("%d\t%d\t%s\t0x%08x\t0x%08x\n", @@ -179,8 +179,8 @@ static void dump_connectors(void) connector = drmModeGetConnector(fd, resources->connectors[i]); if (!connector) { - fprintf(stderr, "could not get connector %i: %s\n", - resources->connectors[i], strerror(errno)); + fprintf(stderr, "could not get connector %i: %d\n", + resources->connectors[i], errno); continue; } @@ -225,8 +225,8 @@ static void dump_crtcs(void) crtc = drmModeGetCrtc(fd, resources->crtcs[i]); if (!crtc) { - fprintf(stderr, "could not get crtc %i: %s\n", - resources->crtcs[i], strerror(errno)); + fprintf(stderr, "could not get crtc %i: %d\n", + resources->crtcs[i], errno); continue; } printf("%d\t%d\t(%d,%d)\t(%dx%d)\n", @@ -252,8 +252,8 @@ static void dump_framebuffers(void) fb = drmModeGetFB(fd, resources->fbs[i]); if (!fb) { - fprintf(stderr, "could not get fb %i: %s\n", - resources->fbs[i], strerror(errno)); + fprintf(stderr, "could not get fb %i: %d\n", + resources->fbs[i], errno); continue; } printf("%u\t(%ux%u)\t%u\n", @@ -288,8 +288,8 @@ void connector_find_mode(struct connector *c) connector = drmModeGetConnector(fd, resources->connectors[i]); if (!connector) { - fprintf(stderr, "could not get connector %i: %s\n", - resources->connectors[i], strerror(errno)); + fprintf(stderr, "could not get connector %i: %d\n", + resources->connectors[i], errno); continue; } @@ -337,8 +337,8 @@ void connector_find_mode(struct connector *c) encoder = drmModeGetEncoder(fd, resources->encoders[i]); if (!encoder) { - fprintf(stderr, "could not get encoder %i: %s\n", - resources->encoders[i], strerror(errno)); + fprintf(stderr, "could not get encoder %i: %d\n", + resources->encoders[i], errno); continue; } @@ -456,8 +456,7 @@ int main(int argc, char **argv) dev.resources = get_resources(&dev); if (!dev.resources) { - fprintf(stderr, "get_resources failed: %s\n", - strerror(errno)); + fprintf(stderr, "get_resources failed: %d\n", errno); drmClose(dev.fd); return 1; } @@ -483,8 +482,8 @@ int main(int argc, char **argv) ret = kms_create(dev.fd, &dev.kms); if (ret) { fprintf(stderr, - "failed to create kms driver: %s\n", - strerror(-ret)); + "failed to create kms driver: %d\n", + ret); break; } diff --git a/tests/ipptest/gem.c b/tests/ipptest/gem.c index a60bc250..ea7426c1 100644 --- a/tests/ipptest/gem.c +++ b/tests/ipptest/gem.c @@ -54,8 +54,8 @@ int exynos_gem_create(int fd, struct drm_exynos_gem_create *gem) } ret = ioctl(fd, DRM_IOCTL_EXYNOS_GEM_CREATE, gem); if (ret < 0) - fprintf(stderr, "failed to create gem buffer: %s\n", - strerror(-ret)); + fprintf(stderr, "failed to create gem buffer: %d\n", ret); + return ret; } @@ -70,8 +70,7 @@ int exynos_gem_mmap(int fd, struct exynos_gem_mmap_data *in_mmap) ret = ioctl(fd, DRM_IOCTL_EXYNOS_GEM_MAP, &arg); if (ret) { - fprintf(stderr, "failed to map dumb buffer: %s\n", - strerror(errno)); + fprintf(stderr, "failed to map dumb buffer: %d\n", errno); return ret; } @@ -80,8 +79,7 @@ int exynos_gem_mmap(int fd, struct exynos_gem_mmap_data *in_mmap) map = mmap(NULL, (size_t)in_mmap->size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, (off_t)arg.offset); if (map == MAP_FAILED) { - fprintf(stderr, "failed to mmap buffer: %s\n", - strerror(errno)); + fprintf(stderr, "failed to mmap buffer: %d\n", errno); return -EFAULT; } @@ -96,7 +94,7 @@ int exynos_gem_close(int fd, struct drm_gem_close *gem_close) ret = ioctl(fd, DRM_IOCTL_GEM_CLOSE, gem_close); if (ret < 0) - fprintf(stderr, "failed to close: %s\n", strerror(-ret)); + fprintf(stderr, "failed to close: %d\n", ret); return ret; } @@ -117,15 +115,13 @@ struct kms_bo* exynos_kms_gem_create(struct kms_driver *kms, ret = kms_bo_create(kms, bo_attribs, &bo); if (ret) { - fprintf(stderr, "failed to alloc buffer: %s\n", - strerror(-ret)); + fprintf(stderr, "failed to alloc buffer: %d\n", ret); return NULL; } ret = kms_bo_get_prop(bo, KMS_PITCH, stride); if (ret) { - fprintf(stderr, "failed to retreive buffer stride: %s\n", - strerror(-ret)); + fprintf(stderr, "failed to retreive buffer stride: %d\n", ret); kms_bo_destroy(&bo); return NULL; } diff --git a/tests/ipptest/util.c b/tests/ipptest/util.c index bf06b3c1..c8efe3d3 100644 --- a/tests/ipptest/util.c +++ b/tests/ipptest/util.c @@ -159,7 +159,7 @@ int util_gem_create_mmap(int fd, struct drm_exynos_gem_create *gem, gem->size = size; if (exynos_gem_create(fd, gem) < 0) { - fprintf(stderr, "failed to gem create: %s\n", strerror(errno)); + fprintf(stderr, "failed to gem create: %d\n", errno); return -1; } @@ -169,7 +169,7 @@ int util_gem_create_mmap(int fd, struct drm_exynos_gem_create *gem, mmap->size = gem->size; if (exynos_gem_mmap(fd, mmap) < 0) { - fprintf(stderr, "failed to gem mmap: %s\n", strerror(errno)); + fprintf(stderr, "failed to gem mmap: %d\n", errno); return -2; } @@ -208,8 +208,7 @@ struct kms_bo *util_kms_gem_create_mmap(struct kms_driver *kms, ret = kms_bo_map(bo, &virtual); if (ret) { - fprintf(stderr, "failed to map buffer: %s\n", - strerror(-ret)); + fprintf(stderr, "failed to map buffer: %d\n", ret); kms_bo_destroy(&bo); return NULL; } @@ -307,7 +306,7 @@ int util_kms_gem_destroy_mmap(struct kms_bo **bo) ret = kms_bo_destroy(bo); if (ret < 0) - fprintf(stderr, "failed kms bo destroy: %s\n", strerror(errno)); + fprintf(stderr, "failed kms bo destroy: %d\n", errno); return ret; } |