From b717f946efbff56ab6f00fe2af44dc0448846eb6 Mon Sep 17 00:00:00 2001 From: Yaroslav Chvanov Date: Sat, 20 May 2023 00:12:46 +0300 Subject: [PATCH] sinowealth-nubwo: idiomatically zero initialize a struct --- src/driver-sinowealth-nubwo.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/driver-sinowealth-nubwo.c b/src/driver-sinowealth-nubwo.c index 9e1423d7..8b49dce5 100644 --- a/src/driver-sinowealth-nubwo.c +++ b/src/driver-sinowealth-nubwo.c @@ -243,8 +243,7 @@ static uint8_t normalize_brightness(int brightness) static int sinowealthnubwo_set_aesthetic(struct ratbag_device *device, struct ratbag_led *led) { - struct sinowealthnubwo_aesthetic_report report; - memset(&report, 0, sizeof(struct sinowealthnubwo_aesthetic_report)); + struct sinowealthnubwo_aesthetic_report report = {0}; report.report_id = SINOWEALTHNUBWO_AESTHETIC_CMD_REPORTID; memcpy(report.cmd, AESTHETIC_CMD, ARRAY_LENGTH(AESTHETIC_CMD)); report.r = led->color.red;