Skip to content

Commit

Permalink
drivers/ide/legacy/hd.c: Array size calculation using sizeof replaced…
Browse files Browse the repository at this point in the history
… with ARRAY_SIZE

This patch replaces an array size calculation in drivers/ide/legacy/hd.c
that was done using sizeof with the ARRAY_SIZE macro.

Tested by compilation on an i386 box using "allyesconfig".
Diffed against Linus' git-tree.

Signed-off-by: Andi Drebes <lists-receive@programmierforen.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
  • Loading branch information
Andi Drebes authored and Bartlomiej Zolnierkiewicz committed Jul 9, 2007
1 parent f50f9d8 commit ecea573
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/ide/legacy/hd.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ struct hd_i_struct {

#ifdef HD_TYPE
static struct hd_i_struct hd_info[] = { HD_TYPE };
static int NR_HD = ((sizeof (hd_info))/(sizeof (struct hd_i_struct)));
static int NR_HD = ARRAY_SIZE(hd_info);
#else
static struct hd_i_struct hd_info[MAX_HD];
static int NR_HD;
Expand Down

0 comments on commit ecea573

Please sign in to comment.