From: "Christian König" <christian.koenig@amd.com>
To: Muhammad Falak R Wani <falakreyaz@gmail.com>,
David Airlie <airlied@linux.ie>
Cc: "Nils Wallménius" <nils.wallmenius@gmail.com>,
"Jammy Zhou" <Jammy.Zhou@amd.com>,
linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
"Alex Deucher" <alexander.deucher@amd.com>,
"Rex Zhu" <Rex.Zhu@amd.com>,
"Christian König" <christian.koenig@amd.com>,
"Dan Carpenter" <dan.carpenter@oracle.com>
Subject: Re: [PATCH v2] drm/amd/powerplay: use ARRAY_SIZE() to calculate array size.
Date: Sat, 14 May 2016 22:00:36 +0200 [thread overview]
Message-ID: <573783E4.7040001@amd.com> (raw)
In-Reply-To: <1463161029-7490-1-git-send-email-falakreyaz@gmail.com>
Am 13.05.2016 um 19:36 schrieb Muhammad Falak R Wani:
> It is preferred to use ARRAY_SIZE() for size calculation, instead
> using sizeof(array)/sizeof(*array). It makes the code more readable.
>
> Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Thanks for the cleanup,
Christian.
> ---
> drivers/gpu/drm/amd/powerplay/smumgr/cz_smumgr.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/cz_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/cz_smumgr.c
> index da18f44..87c023e 100644
> --- a/drivers/gpu/drm/amd/powerplay/smumgr/cz_smumgr.c
> +++ b/drivers/gpu/drm/amd/powerplay/smumgr/cz_smumgr.c
> @@ -639,7 +639,7 @@ static int cz_smu_populate_firmware_entries(struct pp_smumgr *smumgr)
>
> cz_smu->driver_buffer_length = 0;
>
> - for (i = 0; i < sizeof(firmware_list)/sizeof(*firmware_list); i++) {
> + for (i = 0; i < ARRAY_SIZE(firmware_list); i++) {
>
> firmware_type = cz_translate_firmware_enum_to_arg(smumgr,
> firmware_list[i]);
next prev parent reply other threads:[~2016-05-14 20:01 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-13 17:36 [PATCH v2] drm/amd/powerplay: use ARRAY_SIZE() to calculate array size Muhammad Falak R Wani
2016-05-14 20:00 ` Christian König [this message]
2016-05-16 15:53 ` Eric Engestrom
2016-05-17 6:28 ` Muhammad Falak R Wani
2016-05-16 16:18 ` 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=573783E4.7040001@amd.com \
--to=christian.koenig@amd.com \
--cc=Jammy.Zhou@amd.com \
--cc=Rex.Zhu@amd.com \
--cc=airlied@linux.ie \
--cc=alexander.deucher@amd.com \
--cc=dan.carpenter@oracle.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=falakreyaz@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=nils.wallmenius@gmail.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;
as well as URLs for NNTP newsgroup(s).