lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <alpine.LNX.2.00.1007201713040.4741@pobox.suse.cz>
Date:	Tue, 20 Jul 2010 17:13:21 +0200 (CEST)
From:	Jiri Kosina <jkosina@...e.cz>
To:	Kulikov Vasiliy <segooon@...il.com>
Cc:	Kernel Janitors <kernel-janitors@...r.kernel.org>,
	Jing Huang <huangj@...cade.com>,
	"James E.J. Bottomley" <James.Bottomley@...e.de>,
	Krishna Gudipati <kgudipat@...cade.com>,
	linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 07/16] trivial: use ARRAY_SIZE

On Mon, 28 Jun 2010, Kulikov Vasiliy wrote:

> Change sizeof(x) / sizeof(*x) to ARRAY_SIZE(x).
> 
> Signed-off-by: Kulikov Vasiliy <segooon@...il.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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ