From: Muhammad Falak R Wani <falakreyaz@gmail.com>
To: David Airlie <airlied@linux.ie>
Cc: "Alex Deucher" <alexander.deucher@amd.com>,
"Christian König" <christian.koenig@amd.com>,
"Rex Zhu" <Rex.Zhu@amd.com>,
"Nils Wallménius" <nils.wallmenius@gmail.com>,
"Jammy Zhou" <Jammy.Zhou@amd.com>,
"Dan Carpenter" <dan.carpenter@oracle.com>,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: [PATCH v2] drm/amd/powerplay: use ARRAY_SIZE() to calculate array size.
Date: Fri, 13 May 2016 23:06:40 +0530 [thread overview]
Message-ID: <1463161029-7490-1-git-send-email-falakreyaz@gmail.com> (raw)
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>
---
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]);
--
1.9.1
next reply other threads:[~2016-05-13 17:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-13 17:36 Muhammad Falak R Wani [this message]
2016-05-14 20:00 ` Christian König
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=1463161029-7490-1-git-send-email-falakreyaz@gmail.com \
--to=falakreyaz@gmail.com \
--cc=Jammy.Zhou@amd.com \
--cc=Rex.Zhu@amd.com \
--cc=airlied@linux.ie \
--cc=alexander.deucher@amd.com \
--cc=christian.koenig@amd.com \
--cc=dan.carpenter@oracle.com \
--cc=dri-devel@lists.freedesktop.org \
--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
all inboxes | Powered by JetHome®