From: Thierry Reding <thierry.reding@gmail.com>
To: "Jérémy Lefaure" <jeremy.lefaure@lse.epita.fr>
Cc: amd-gfx@lists.freedesktop.org, intel-gfx@lists.freedesktop.org,
nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
"Joonas Lahtinen" <joonas.lahtinen@linux.intel.com>,
linux-kernel@vger.kernel.org,
"Rodrigo Vivi" <rodrigo.vivi@intel.com>,
"Alex Deucher" <alexander.deucher@amd.com>,
intel-gvt-dev@lists.freedesktop.org,
"Christian König" <christian.koenig@amd.com>,
"Zhi Wang" <zhi.a.wang@intel.com>,
"Ben Skeggs" <bskeggs@redhat.com>
Subject: Re: [PATCH 06/18] drm: use ARRAY_SIZE
Date: Mon, 2 Oct 2017 10:27:03 +0200 [thread overview]
Message-ID: <20171002082703.GA24250@ulmo> (raw)
In-Reply-To: <20171001193101.8898-7-jeremy.lefaure@lse.epita.fr>
[-- Attachment #1.1: Type: text/plain, Size: 1109 bytes --]
On Sun, Oct 01, 2017 at 03:30:44PM -0400, Jérémy Lefaure wrote:
> Using the ARRAY_SIZE macro improves the readability of the code. Also,
> it is not always useful to use a variable to store this constant
> calculated at compile time nor to re-invent the ARRAY_SIZE macro.
>
> Found with Coccinelle with the following semantic patch:
> @r depends on (org || report)@
> type T;
> T[] E;
> position p;
> @@
> (
> (sizeof(E)@p /sizeof(*E))
> |
> (sizeof(E)@p /sizeof(E[...]))
> |
> (sizeof(E)@p /sizeof(T))
> )
>
> Signed-off-by: Jérémy Lefaure <jeremy.lefaure@lse.epita.fr>
> ---
> drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 9 +++++----
> drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 9 +++++----
> drivers/gpu/drm/gma500/psb_intel_sdvo.c | 9 ++++-----
> drivers/gpu/drm/i915/gvt/vgpu.c | 3 ++-
> drivers/gpu/drm/nouveau/nvkm/subdev/bios/init.c | 7 ++++---
> drivers/gpu/drm/via/via_verifier.c | 10 ++++------
> 6 files changed, 24 insertions(+), 23 deletions(-)
Reviewed-by: Thierry Reding <treding@nvidia.com>
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
[-- Attachment #2: Type: text/plain, Size: 160 bytes --]
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2017-10-02 8:27 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-01 19:30 [PATCH 00/18] use ARRAY_SIZE macro Jérémy Lefaure
2017-10-01 19:30 ` [PATCH 06/18] drm: use ARRAY_SIZE Jérémy Lefaure
[not found] ` <20171001193101.8898-7-jeremy.lefaure-tU7rkvAWjlwhT4uAktR2oQ@public.gmane.org>
2017-10-02 7:43 ` Jani Nikula
2017-10-02 8:27 ` Thierry Reding [this message]
2017-10-01 22:01 ` [PATCH 00/18] use ARRAY_SIZE macro Tobin C. Harding
2017-10-02 0:52 ` Jérémy Lefaure
2017-10-02 5:35 ` Greg KH
2017-10-02 19:22 ` J. Bruce Fields
2017-10-03 1:33 ` Jérémy Lefaure
2017-10-05 17:57 ` J. Bruce Fields
2017-10-02 16:37 ` Mauro Carvalho Chehab
2017-10-02 17:05 ` Zhi Wang
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=20171002082703.GA24250@ulmo \
--to=thierry.reding@gmail.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=bskeggs@redhat.com \
--cc=christian.koenig@amd.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-gvt-dev@lists.freedesktop.org \
--cc=jeremy.lefaure@lse.epita.fr \
--cc=joonas.lahtinen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=nouveau@lists.freedesktop.org \
--cc=rodrigo.vivi@intel.com \
--cc=zhi.a.wang@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox