All of lore.kernel.org
 help / color / mirror / Atom feed
From: Allen <allen.lkml@gmail.com>
To: linux-s390@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Allen Pais <allen.lkml@gmail.com>
Subject: [PATCH] Use ARRAY_SIZE instead of dividing sizeof array with sizeof an element.
Date: Fri,  8 Feb 2019 08:11:10 +0530	[thread overview]
Message-ID: <20190208024110.8021-1-allen.lkml@gmail.com> (raw)

From: Allen Pais <allen.lkml@gmail.com>

This issue was detected with the help of Coccinelle.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
---
 arch/s390/tools/gen_opcode_table.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/s390/tools/gen_opcode_table.c b/arch/s390/tools/gen_opcode_table.c
index a1bc02b29c81..468b70c85f62 100644
--- a/arch/s390/tools/gen_opcode_table.c
+++ b/arch/s390/tools/gen_opcode_table.c
@@ -138,7 +138,7 @@ static struct insn_type *insn_format_to_type(char *format)
 	strcpy(tmp, format);
 	base_format = tmp;
 	base_format = strsep(&base_format, "_");
-	for (i = 0; i < sizeof(insn_type_table) / sizeof(insn_type_table[0]); i++) {
+	for (i = 0; i < ARRAY_SIZE(insn_type_table); i++) {
 		ptr = insn_type_table[i].format;
 		while (*ptr) {
 			if (!strcmp(base_format, *ptr))
-- 
2.19.1

             reply	other threads:[~2019-02-08  2:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-08  2:41 Allen [this message]
2019-02-08  8:38 ` [PATCH] Use ARRAY_SIZE instead of dividing sizeof array with sizeof an element Heiko Carstens
2019-02-08 11:05   ` Allen

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=20190208024110.8021-1-allen.lkml@gmail.com \
    --to=allen.lkml@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    /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.