]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/amd: Use dynamic array size declaration for amdgpu_connector_add_common_modes()
authorMario Limonciello <mario.limonciello@amd.com>
Wed, 24 Sep 2025 16:16:22 +0000 (11:16 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 25 Sep 2025 19:53:55 +0000 (15:53 -0400)
commit123a1750c5e0dcbfec953647045947be9620a7d8
treebe0e8cab896bf55a19115514fd0400e602002a7e
parent1f721ebcf312df88c6da6457e0ff21c33613f73c
drm/amd: Use dynamic array size declaration for amdgpu_connector_add_common_modes()

[Why]
Adding or removing a mode from common_modes[] can be fragile if a user
forgot to update the for loop boundaries.

[How]
Use ARRAY_SIZE() to detect size of the array and use that instead.

Cc: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Link: https://lore.kernel.org/r/20250924161624.1975819-4-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_connectors.c