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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 05 Feb 2007 09:24:10 +0000
From:	Ian Molton <spyro@....com>
To:	"Ahmed S. Darwish" <darwish.07@...il.com>
Cc:	kernel@...tstofly.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2.6.20] arch ARM: Use ARRAY_SIZE macro when appropriate

Ahmed S. Darwish wrote:
> Hi all,
> 
> A patch to use ARRAY_SIZE macro already defined in linux/kernel.h

Looks good. I can only speak for arm26 though, however trivial this is.

Signed-off-by: Ahmed S. Darwish <darwish.07@...il.com>
Acked-by: Ian Molton <spyro@....com

> ---
> Patch isn't compile checked cause I have no ARM machine at hand.
> Thanks,


diff --git a/arch/arm/kernel/ecard.c b/arch/arm/kernel/ecard.c
index 71257e3..f1c0fb9 100644
--- a/arch/arm/kernel/ecard.c
+++ b/arch/arm/kernel/ecard.c
@@ -1009,7 +1009,7 @@ ecard_probe(int slot, card_type_t type)
  		ec->fiqmask = 4;
  	}

-	for (i = 0; i < sizeof(blacklist) / sizeof(*blacklist); i++)
+	for (i = 0; i < ARRAY_SIZE(blacklist); i++)
  		if (blacklist[i].manufacturer == ec->cid.manufacturer &&
  		    blacklist[i].product == ec->cid.product) {
  			ec->card_desc = blacklist[i].type;
diff --git a/arch/arm26/kernel/ecard.c b/arch/arm26/kernel/ecard.c
index 9dbc172..e2bcefc 100644
--- a/arch/arm26/kernel/ecard.c
+++ b/arch/arm26/kernel/ecard.c
@@ -665,7 +665,7 @@ ecard_probe(int slot, card_type_t type)
  		ec->fiqmask = 4;
  	}

-	for (i = 0; i < sizeof(blacklist) / sizeof(*blacklist); i++)
+	for (i = 0; i < ARRAY_SIZE(blacklist); i++)
  		if (blacklist[i].manufacturer == ec->cid.manufacturer &&
  		    blacklist[i].product == ec->cid.product) {
  			ec->card_desc = blacklist[i].type;


-
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