diff options
author | Alexander Orzechowski <alex@ozal.ski> | 2023-10-03 01:51:07 -0400 |
---|---|---|
committer | Alexander Orzechowski <alex@ozal.ski> | 2023-10-03 01:51:07 -0400 |
commit | 1b0694b79481643cb456d03e1be50a1b4f6ca591 (patch) | |
tree | c693c5de3ee7ebd52873f6ec063118408f0bd28a /backend/drm | |
parent | a09d6494397bdd28a3254d2e646212afb5a3049c (diff) |
treewide: Migrate from sizeof(struct) to sizeof(*pointer) where practical
Diffstat (limited to 'backend/drm')
-rw-r--r-- | backend/drm/atomic.c | 4 | ||||
-rw-r--r-- | backend/drm/backend.c | 2 | ||||
-rw-r--r-- | backend/drm/monitor.c | 3 |
3 files changed, 4 insertions, 5 deletions
diff --git a/backend/drm/atomic.c b/backend/drm/atomic.c index c2005f96..4715c6f0 100644 --- a/backend/drm/atomic.c +++ b/backend/drm/atomic.c @@ -117,7 +117,7 @@ bool create_gamma_lut_blob(struct wlr_drm_backend *drm, return true; } - struct drm_color_lut *gamma = malloc(size * sizeof(struct drm_color_lut)); + struct drm_color_lut *gamma = malloc(size * sizeof(*gamma)); if (gamma == NULL) { wlr_log(WLR_ERROR, "Failed to allocate gamma table"); return false; @@ -133,7 +133,7 @@ bool create_gamma_lut_blob(struct wlr_drm_backend *drm, } if (drmModeCreatePropertyBlob(drm->fd, gamma, - size * sizeof(struct drm_color_lut), blob_id) != 0) { + size * sizeof(*gamma), blob_id) != 0) { wlr_log_errno(WLR_ERROR, "Unable to create gamma LUT property blob"); free(gamma); return false; diff --git a/backend/drm/backend.c b/backend/drm/backend.c index 244a2df1..df02c6b3 100644 --- a/backend/drm/backend.c +++ b/backend/drm/backend.c @@ -202,7 +202,7 @@ struct wlr_backend *wlr_drm_backend_create(struct wl_display *display, wlr_log(WLR_INFO, "Initializing DRM backend for %s (%s)", name, version->name); drmFreeVersion(version); - struct wlr_drm_backend *drm = calloc(1, sizeof(struct wlr_drm_backend)); + struct wlr_drm_backend *drm = calloc(1, sizeof(*drm)); if (!drm) { wlr_log_errno(WLR_ERROR, "Allocation failed"); return NULL; diff --git a/backend/drm/monitor.c b/backend/drm/monitor.c index 539e7925..4b1eeaa9 100644 --- a/backend/drm/monitor.c +++ b/backend/drm/monitor.c @@ -67,8 +67,7 @@ struct wlr_drm_backend_monitor *drm_backend_monitor_create( struct wlr_backend *multi, struct wlr_backend *primary_drm, struct wlr_session *session) { - struct wlr_drm_backend_monitor *monitor = - calloc(1, sizeof(struct wlr_drm_backend_monitor)); + struct wlr_drm_backend_monitor *monitor = calloc(1, sizeof(*monitor)); if (!monitor) { wlr_log_errno(WLR_ERROR, "Allocation failed"); return NULL; |