]> www.infradead.org Git - users/hch/misc.git/commitdiff
drm/amd: Copy entire structure in amdgpu_acpi_get_backlight_caps()
authorMario Limonciello <mario.limonciello@amd.com>
Fri, 28 Feb 2025 18:51:41 +0000 (12:51 -0600)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 5 Mar 2025 15:42:37 +0000 (10:42 -0500)
As new members are introduced to the structure copying the entire
structure will help avoid missing them.

Reviewed-by: Alex Hung <alex.hung@amd.com>
Link: https://lore.kernel.org/r/20250228185145.186319-2-mario.limonciello@amd.com
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c

index b8d4e07d2043ed5425dab987fa8e519c9a06dbcc..515c6f32448ded8c284ece5fc7bec8e09fe6a925 100644 (file)
@@ -1277,11 +1277,7 @@ void amdgpu_acpi_get_backlight_caps(struct amdgpu_dm_backlight_caps *caps)
 {
        struct amdgpu_atif *atif = &amdgpu_acpi_priv.atif;
 
-       caps->caps_valid = atif->backlight_caps.caps_valid;
-       caps->min_input_signal = atif->backlight_caps.min_input_signal;
-       caps->max_input_signal = atif->backlight_caps.max_input_signal;
-       caps->ac_level = atif->backlight_caps.ac_level;
-       caps->dc_level = atif->backlight_caps.dc_level;
+       memcpy(caps, &atif->backlight_caps, sizeof(*caps));
 }
 
 /**