From: Heiko Carstens <heiko.carstens@de.ibm.com>
To: Allen <allen.lkml@gmail.com>
Cc: linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Use ARRAY_SIZE instead of dividing sizeof array with sizeof an element.
Date: Fri, 8 Feb 2019 09:38:08 +0100 [thread overview]
Message-ID: <20190208083808.GB2803@osiris> (raw)
In-Reply-To: <20190208024110.8021-1-allen.lkml@gmail.com>
On Fri, Feb 08, 2019 at 08:11:10AM +0530, Allen wrote:
> 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++) {
This does not compile.
next prev parent reply other threads:[~2019-02-08 8:38 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-08 2:41 [PATCH] Use ARRAY_SIZE instead of dividing sizeof array with sizeof an element Allen
2019-02-08 8:38 ` Heiko Carstens [this message]
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=20190208083808.GB2803@osiris \
--to=heiko.carstens@de.ibm.com \
--cc=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox