diff options
author | Hans de Goede <hdegoede@redhat.com> | 2023-03-12 20:17:47 +0100 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2023-03-22 00:47:59 -0400 |
commit | ceb4a5619c734ea679bf5a2446e6869056e353d4 (patch) | |
tree | 6f21d422e95f64acad9cf704767d0be4c47655b4 /drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c | |
parent | 4db231d7dd80163fd251635f81280f1c93a393ab (diff) |
drm/amd/display/amdgpu_dm: Refactor register_backlight_device()
Refactor register_backlight_device():
1) Turn the connector-type + signal check into an early exit
condition to avoid the indentation level of the rest of the code
2) Add an array bounds check for the arrays indexed by dm->num_of_edps
3) register_backlight_device() always increases dm->num_of_edps if
amdgpu_dm_register_backlight_device() has assigned a backlight_dev to
the current dm->backlight_link[dm->num_of_edps] slot.
So on its next call dm->backlight_dev[dm->num_of_edps] always point to
the next empty slot and the "if (!dm->backlight_dev[dm->num_of_edps])"
check will thus always succeed and can be removed.
4) Add a bl_idx local variable to use as array index, rather then
using dm->num_of_edps to improve the code readability.
Reviewed-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c')
0 files changed, 0 insertions, 0 deletions