From: Gurchetan Singh Date: Mon, 20 Mar 2017 21:05:16 +0000 (-0700) Subject: minigbm: cros_gralloc: remove memsets X-Git-Url: http://git.osdn.net/view?p=android-x86%2Fexternal-minigbm.git;a=commitdiff_plain;h=eb86a70aa5559362608b16df47b26b12660eca87 minigbm: cros_gralloc: remove memsets The C++ standard says value initialization results in zero initialization for structs, so our memsets are unecessary. BUG=chromium:616275 TEST=compiles Change-Id: I1744b237790cb79d2a8be92beffdb2ee9829f4e2 Reviewed-on: https://chromium-review.googlesource.com/457287 Commit-Ready: Gurchetan Singh Tested-by: Gurchetan Singh Reviewed-by: Stéphane Marchesin Reviewed-by: Gurchetan Singh --- diff --git a/cros_gralloc/cros_alloc_device.cc b/cros_gralloc/cros_alloc_device.cc index 4ee1897..63b455c 100644 --- a/cros_gralloc/cros_alloc_device.cc +++ b/cros_gralloc/cros_alloc_device.cc @@ -33,7 +33,6 @@ static struct cros_gralloc_bo *cros_gralloc_bo_create(struct driver *drv, int wi } bo = new cros_gralloc_bo(); - memset(bo, 0, sizeof(*bo)); bo->bo = drv_bo_create(drv, width, height, drv_format, drv_usage); if (!bo->bo) { @@ -66,7 +65,6 @@ static struct cros_gralloc_handle *cros_gralloc_handle_from_bo(struct bo *bo) struct cros_gralloc_handle *hnd; hnd = new cros_gralloc_handle(); - memset(hnd, 0, sizeof(*hnd)); num_planes = drv_bo_get_num_planes(bo); @@ -184,7 +182,6 @@ int cros_gralloc_open(const struct hw_module_t *mod, const char *name, struct hw } auto alloc = new alloc_device_t(); - memset(alloc, 0, sizeof(*alloc)); alloc->alloc = cros_gralloc_alloc; alloc->free = cros_gralloc_free;