From: Jiri Kosina <jkosina@suse.cz>
To: Kulikov Vasiliy <segooon@gmail.com>
Cc: Kernel Janitors <kernel-janitors@vger.kernel.org>,
Jing Huang <huangj@brocade.com>,
"James E.J. Bottomley" <James.Bottomley@suse.de>,
Krishna Gudipati <kgudipat@brocade.com>,
linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 07/16] trivial: use ARRAY_SIZE
Date: Tue, 20 Jul 2010 17:13:21 +0200 (CEST) [thread overview]
Message-ID: <alpine.LNX.2.00.1007201713040.4741@pobox.suse.cz> (raw)
In-Reply-To: <1277726109-24633-1-git-send-email-segooon@gmail.com>
On Mon, 28 Jun 2010, Kulikov Vasiliy wrote:
> Change sizeof(x) / sizeof(*x) to ARRAY_SIZE(x).
>
> Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
> ---
> drivers/scsi/bfa/bfa_fcs.c | 10 ++++------
> 1 files changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/scsi/bfa/bfa_fcs.c b/drivers/scsi/bfa/bfa_fcs.c
> index 3516172..153cb2a 100644
> --- a/drivers/scsi/bfa/bfa_fcs.c
> +++ b/drivers/scsi/bfa/bfa_fcs.c
> @@ -86,7 +86,7 @@ bfa_fcs_attach(struct bfa_fcs_s *fcs, struct bfa_s *bfa, struct bfad_s *bfad,
> bfa_attach_fcs(bfa);
> fcbuild_init();
>
> - for (i = 0; i < sizeof(fcs_modules) / sizeof(fcs_modules[0]); i++) {
> + for (i = 0; i < ARRAY_SIZE(fcs_modules); i++) {
> mod = &fcs_modules[i];
> if (mod->attach)
> mod->attach(fcs);
> @@ -102,7 +102,7 @@ bfa_fcs_init(struct bfa_fcs_s *fcs)
> int i;
> struct bfa_fcs_mod_s *mod;
>
> - for (i = 0; i < sizeof(fcs_modules) / sizeof(fcs_modules[0]); i++) {
> + for (i = 0; i < ARRAY_SIZE(fcs_modules); i++) {
> mod = &fcs_modules[i];
> if (mod->modinit)
> mod->modinit(fcs);
> @@ -163,13 +163,11 @@ void
> bfa_fcs_exit(struct bfa_fcs_s *fcs)
> {
> struct bfa_fcs_mod_s *mod;
> - int nmods, i;
> + int i;
>
> bfa_wc_init(&fcs->wc, bfa_fcs_exit_comp, fcs);
>
> - nmods = sizeof(fcs_modules) / sizeof(fcs_modules[0]);
> -
> - for (i = 0; i < nmods; i++) {
> + for (i = 0; i < ARRAY_SIZE(fcs_modules); i++) {
>
> mod = &fcs_modules[i];
> if (mod->modexit) {
I have folded this patch into the other bfa change you made, and applied.
Thanks,
--
Jiri Kosina
SUSE Labs, Novell Inc.
prev parent reply other threads:[~2010-07-20 15:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-28 11:55 Kulikov Vasiliy
2010-07-20 15:13 ` Jiri Kosina [this message]
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=alpine.LNX.2.00.1007201713040.4741@pobox.suse.cz \
--to=jkosina@suse.cz \
--cc=James.Bottomley@suse.de \
--cc=huangj@brocade.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=kgudipat@brocade.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=segooon@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®