All of lore.kernel.org
 help / color / mirror / Atom feed
From: Linus Probert <linus.probert@gmail.com>
To: "Harry Wentland" <harry.wentland@amd.com>,
	"Leo Li" <sunpeng.li@amd.com>,
	"Rodrigo Siqueira" <siqueira@igalia.com>,
	"Alex Deucher" <alexander.deucher@amd.com>,
	"Christian König" <christian.koenig@amd.com>,
	"David Airlie" <airlied@gmail.com>,
	"Simona Vetter" <simona@ffwll.ch>
Cc: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org,
	Linus Probert <linus.probert@gmail.com>
Subject: [PATCH 0/2] drm/amd/display: Replace NUM_ELEMENTS -> ARRAY_SIZE
Date: Fri,  3 Apr 2026 10:22:05 +0200	[thread overview]
Message-ID: <20260403082207.1533450-1-linus.probert@gmail.com> (raw)

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(-)

-- 
2.53.0


             reply	other threads:[~2026-04-03  9:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-03  8:22 Linus Probert [this message]
2026-04-03  8:22 ` [PATCH 1/2] drm/amd/display: Replace inline NUM_ELEMENTS macro with ARRAY_SIZE Linus Probert
2026-04-03  8:22 ` [PATCH 2/2] drm/amd/display: Remove unused NUM_ELEMENTS macros Linus Probert
2026-04-03 13:58   ` Alex Deucher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260403082207.1533450-1-linus.probert@gmail.com \
    --to=linus.probert@gmail.com \
    --cc=airlied@gmail.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=harry.wentland@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=simona@ffwll.ch \
    --cc=siqueira@igalia.com \
    --cc=sunpeng.li@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.