drm/amd/display: Fix writeback format loop and variable init

[WHAT]
1. Use ARRAY_SIZE() instead of manual sizeof division for the
   format array iteration. Add a break statement to exit the loop
   early once a matching format is found.
2. Remove redundant zero initialization of res since all paths
   assign before use.

Assisted-by: Copilot:Claude-Opus-4.6
Reviewed-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com>
Signed-off-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Tested-by: Dan Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
Alex Hung 2026-05-25 12:08:20 -06:00 • committed by Alex Deucher
commit 042b0a3980