2005-12-15 05:45:57

by Dmitry Torokhov

[permalink] [raw]
Subject: [patch 3/3] wbsd: make use of ARRAY_SIZE() macro

wbsd: make use of ARRAY_SIZE() macro

Signed-off-by: Dmitry Torokhov <[email protected]>
---

drivers/mmc/wbsd.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)

Index: work/drivers/mmc/wbsd.c
===================================================================
--- work.orig/drivers/mmc/wbsd.c
+++ work/drivers/mmc/wbsd.c
@@ -1399,11 +1399,11 @@ static int __devinit wbsd_scan(struct wb
* Iterate through all ports, all codes to
* find hardware that is in our known list.
*/
- for (i = 0; i < sizeof(config_ports) / sizeof(int); i++) {
+ for (i = 0; i < ARRAY_SIZE(config_ports); i++) {
if (!request_region(config_ports[i], 2, DRIVER_NAME))
continue;

- for (j = 0; j < sizeof(unlock_codes) / sizeof(int); j++) {
+ for (j = 0; j < ARRAY_SIZE(unlock_codes); j++) {
id = 0xFFFF;

host->config = config_ports[i];
@@ -1419,7 +1419,7 @@ static int __devinit wbsd_scan(struct wb

wbsd_lock_config(host);

- for (k = 0; k < sizeof(valid_ids) / sizeof(int); k++) {
+ for (k = 0; k < ARRAY_SIZE(valid_ids); k++) {
if (id == valid_ids[k]) {
host->chip_id = id;



2005-12-15 16:10:00

by Pierre Ossman

[permalink] [raw]
Subject: Re: [patch 3/3] wbsd: make use of ARRAY_SIZE() macro

Dmitry Torokhov wrote:
> wbsd: make use of ARRAY_SIZE() macro
>
> Signed-off-by: Dmitry Torokhov <[email protected]>
> ---
>
>

Acked-by: Pierre Ossman <[email protected]>

(Provided it's fixed to come before the lindent patch.)

2005-12-15 16:24:19

by Russell King

[permalink] [raw]
Subject: Re: [patch 3/3] wbsd: make use of ARRAY_SIZE() macro

On Thu, Dec 15, 2005 at 05:09:59PM +0100, Pierre Ossman wrote:
> Dmitry Torokhov wrote:
> > wbsd: make use of ARRAY_SIZE() macro
> >
> > Signed-off-by: Dmitry Torokhov <[email protected]>
> > ---
> >
> >
>
> Acked-by: Pierre Ossman <[email protected]>
>
> (Provided it's fixed to come before the lindent patch.)

Ok, I've queued up these two patches and fixed this one to apply.

--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of: 2.6 Serial core