aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Jakobi2015-03-16 17:19:28 -0500
committerEmil Velikov2015-03-16 17:21:03 -0500
commit736d6a1f0f8292fe3f3d0b38f5d69b8693767537 (patch)
treeae3d2f5fba719895702ea280d8e3ac79146ca89f /tests/exynos/exynos_fimg2d_test.c
parent89037326ca6012ba18be29dc6587e11617164400 (diff)
downloadexternal-libgbm-736d6a1f0f8292fe3f3d0b38f5d69b8693767537.tar.gz
external-libgbm-736d6a1f0f8292fe3f3d0b38f5d69b8693767537.tar.xz
external-libgbm-736d6a1f0f8292fe3f3d0b38f5d69b8693767537.zip
exynos: use structure initialization instead of memset
Keeps the code cleaner, since the structs have to be initialized once anyway. Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Reviewed-by: Inki Dae <inki.dae@samsung.com> Tested-by: Joonyoung Shim <jy0922.shim@samsung.com> [evelikov: squash trivial conflict] Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Conflicts: tests/exynos/exynos_fimg2d_test.c
Diffstat (limited to 'tests/exynos/exynos_fimg2d_test.c')
-rw-r--r--tests/exynos/exynos_fimg2d_test.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/tests/exynos/exynos_fimg2d_test.c b/tests/exynos/exynos_fimg2d_test.c
index 52d5543f..f674da8c 100644
--- a/tests/exynos/exynos_fimg2d_test.c
+++ b/tests/exynos/exynos_fimg2d_test.c
@@ -255,7 +255,7 @@ static void wait_for_user_input(int last)
255static int g2d_solid_fill_test(struct exynos_device *dev, struct exynos_bo *dst) 255static int g2d_solid_fill_test(struct exynos_device *dev, struct exynos_bo *dst)
256{ 256{
257 struct g2d_context *ctx; 257 struct g2d_context *ctx;
258 struct g2d_image img; 258 struct g2d_image img = {0};
259 unsigned int count, img_w, img_h; 259 unsigned int count, img_w, img_h;
260 int ret = 0; 260 int ret = 0;
261 261
@@ -263,7 +263,6 @@ static int g2d_solid_fill_test(struct exynos_device *dev, struct exynos_bo *dst)
263 if (!ctx) 263 if (!ctx)
264 return -EFAULT; 264 return -EFAULT;
265 265
266 memset(&img, 0, sizeof(struct g2d_image));
267 img.bo[0] = dst->handle; 266 img.bo[0] = dst->handle;
268 267
269 printf("solid fill test.\n"); 268 printf("solid fill test.\n");
@@ -306,7 +305,7 @@ static int g2d_copy_test(struct exynos_device *dev, struct exynos_bo *src,
306 enum e_g2d_buf_type type) 305 enum e_g2d_buf_type type)
307{ 306{
308 struct g2d_context *ctx; 307 struct g2d_context *ctx;
309 struct g2d_image src_img, dst_img; 308 struct g2d_image src_img = {0}, dst_img = {0};
310 unsigned int src_x, src_y, dst_x, dst_y, img_w, img_h; 309 unsigned int src_x, src_y, dst_x, dst_y, img_w, img_h;
311 unsigned long userptr, size; 310 unsigned long userptr, size;
312 int ret; 311 int ret;
@@ -315,8 +314,6 @@ static int g2d_copy_test(struct exynos_device *dev, struct exynos_bo *src,
315 if (!ctx) 314 if (!ctx)
316 return -EFAULT; 315 return -EFAULT;
317 316
318 memset(&src_img, 0, sizeof(struct g2d_image));
319 memset(&dst_img, 0, sizeof(struct g2d_image));
320 dst_img.bo[0] = dst->handle; 317 dst_img.bo[0] = dst->handle;
321 318
322 src_x = 0; 319 src_x = 0;
@@ -389,7 +386,7 @@ static int g2d_copy_with_scale_test(struct exynos_device *dev,
389 enum e_g2d_buf_type type) 386 enum e_g2d_buf_type type)
390{ 387{
391 struct g2d_context *ctx; 388 struct g2d_context *ctx;
392 struct g2d_image src_img, dst_img; 389 struct g2d_image src_img = {0}, dst_img = {0};
393 unsigned int src_x, src_y, img_w, img_h; 390 unsigned int src_x, src_y, img_w, img_h;
394 unsigned long userptr, size; 391 unsigned long userptr, size;
395 int ret; 392 int ret;
@@ -398,8 +395,6 @@ static int g2d_copy_with_scale_test(struct exynos_device *dev,
398 if (!ctx) 395 if (!ctx)
399 return -EFAULT; 396 return -EFAULT;
400 397
401 memset(&src_img, 0, sizeof(struct g2d_image));
402 memset(&dst_img, 0, sizeof(struct g2d_image));
403 dst_img.bo[0] = dst->handle; 398 dst_img.bo[0] = dst->handle;
404 399
405 src_x = 0; 400 src_x = 0;
@@ -475,7 +470,7 @@ static int g2d_blend_test(struct exynos_device *dev,
475 enum e_g2d_buf_type type) 470 enum e_g2d_buf_type type)
476{ 471{
477 struct g2d_context *ctx; 472 struct g2d_context *ctx;
478 struct g2d_image src_img, dst_img; 473 struct g2d_image src_img = {0}, dst_img = {0};
479 unsigned int src_x, src_y, dst_x, dst_y, img_w, img_h; 474 unsigned int src_x, src_y, dst_x, dst_y, img_w, img_h;
480 unsigned long userptr, size; 475 unsigned long userptr, size;
481 int ret; 476 int ret;
@@ -484,8 +479,6 @@ static int g2d_blend_test(struct exynos_device *dev,
484 if (!ctx) 479 if (!ctx)
485 return -EFAULT; 480 return -EFAULT;
486 481
487 memset(&src_img, 0, sizeof(struct g2d_image));
488 memset(&dst_img, 0, sizeof(struct g2d_image));
489 dst_img.bo[0] = dst->handle; 482 dst_img.bo[0] = dst->handle;
490 483
491 src_x = 0; 484 src_x = 0;