Skip to content

drm/amd/display: Replace NUM_ELEMENTS -> ARRAY_SIZE

Linus Probert amd-gfx dri-devel lkml 1 version Applied

Status from this message: Applied the series. Thanks!

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 1 replyApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/2drm/amd/display: Replace inline NUM_ELEMENTS macro with ARRAY_SIZEdrivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c drivers/gpu/drm/amd/display/dc/dce/dce_clock_source.c+6 -50 replies
2/2drm/amd/display: Remove unused NUM_ELEMENTS macrosdrivers/gpu/drm/amd/display/dc/dpp/dcn10/dcn10_dpp_cm.c drivers/gpu/drm/amd/display/dc/dpp/dcn401/dcn401_dpp_cm.c drivers/gpu/drm/amd/display/dc/mpc/dcn20/dcn20_mpc.c +1 more+0 -121 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] drm/amd/display: Replace NUM_ELEMENTS -> ARRAY_SIZE

There's a coccinelle script which attempts to replace cases where sizeof array is divided by sizeof an element. Most of these occurences have been handled but a few remained in this driver in the shape of the NUM_ELEMENTS macro.

In two cases the NUM_ELEMENTS macro has been removed and its use has been replaced by ARRAY_SIZE. (1)
In 4 files the NUM_ELEMENTS macro existed but was never used so it has just been removed. (2)

I couldn't trace why these cases hadn't been picked up by the coccinelle check. Just NAK this if there's a reason for NUM_ELEMENTS to be kept as is. Thanks.

Linus Probert (2):
drm/amd/display: Replace inline NUM_ELEMENTS macro with ARRAY_SIZE drm/amd/display: Remove unused NUM_ELEMENTS macros

 drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c     | 5 +++--
 drivers/gpu/drm/amd/display/dc/dce/dce_clock_source.c     | 6 +++---
 drivers/gpu/drm/amd/display/dc/dpp/dcn10/dcn10_dpp_cm.c   | 3 ---
 drivers/gpu/drm/amd/display/dc/dpp/dcn401/dcn401_dpp_cm.c | 3 ---
 drivers/gpu/drm/amd/display/dc/mpc/dcn20/dcn20_mpc.c      | 2 --
 drivers/gpu/drm/amd/display/dc/mpc/dcn30/dcn30_mpc.c      | 4 ----
 6 files changed, 6 insertions(+), 17 deletions(-)
Signature · 1 line
2.53.0