2010-06-28 11:54:52

by Kulikov Vasiliy

[permalink] [raw]
Subject: [PATCH 01/16] trivial: use ARRAY_SIZE

Change sizeof(x) / sizeof(*x) to ARRAY_SIZE(x).

Signed-off-by: Kulikov Vasiliy <[email protected]>
---
drivers/block/cciss.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index 51ceaee..e1e7143 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -335,7 +335,7 @@ static void cciss_map_sg_chain_block(ctlr_info_t *h, CommandList_struct *c,
static const char *raid_label[] = { "0", "4", "1(1+0)", "5", "5+1", "ADG",
"UNKNOWN"
};
-#define RAID_UNKNOWN (sizeof(raid_label) / sizeof(raid_label[0])-1)
+#define RAID_UNKNOWN (ARRAY_SIZE(raid_label)-1)

#ifdef CONFIG_PROC_FS

--
1.7.0.4


2010-06-28 19:06:31

by Mike Miller

[permalink] [raw]
Subject: RE: [PATCH 01/16] trivial: use ARRAY_SIZE



> -----Original Message-----
> From: Kulikov Vasiliy [mailto:[email protected]]
> Sent: Monday, June 28, 2010 6:55 AM
> To: [email protected]
> Cc: Kernel Janitors; Miller, Mike (OS Dev); Jens Axboe;
> Stephen M. Cameron; Andrew Morton; Patterson, Andrew D
> (LeftHand Networks); ISS StorageDev; [email protected]
> Subject: [PATCH 01/16] trivial: use ARRAY_SIZE
>
> Change sizeof(x) / sizeof(*x) to ARRAY_SIZE(x).
>
> Signed-off-by: Kulikov Vasiliy <[email protected]>
Acked-by: Mike Miller <[email protected]>
> ---
> drivers/block/cciss.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
> index 51ceaee..e1e7143 100644
> --- a/drivers/block/cciss.c
> +++ b/drivers/block/cciss.c
> @@ -335,7 +335,7 @@ static void
> cciss_map_sg_chain_block(ctlr_info_t *h, CommandList_struct
> *c, static const char *raid_label[] = { "0", "4", "1(1+0)",
> "5", "5+1", "ADG",
> "UNKNOWN"
> };
> -#define RAID_UNKNOWN (sizeof(raid_label) / sizeof(raid_label[0])-1)
> +#define RAID_UNKNOWN (ARRAY_SIZE(raid_label)-1)
>
> #ifdef CONFIG_PROC_FS
>
> --
> 1.7.0.4
>
> -

2010-07-20 15:02:31

by Jiri Kosina

[permalink] [raw]
Subject: RE: [PATCH 01/16] trivial: use ARRAY_SIZE

On Mon, 28 Jun 2010, Miller, Mike (OS Dev) wrote:

> > Change sizeof(x) / sizeof(*x) to ARRAY_SIZE(x).
> >
> > Signed-off-by: Kulikov Vasiliy <[email protected]>
> Acked-by: Mike Miller <[email protected]>

Not present in linux-next as of today. Applied, thanks.

--
Jiri Kosina
SUSE Labs, Novell Inc.