Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 945f390f authored by Tobias Klauser's avatar Tobias Klauser Committed by Linus Torvalds
Browse files

[PATCH] drivers/block: Use ARRAY_SIZE macro



Use ARRAY_SIZE macro instead of sizeof(x)/sizeof(x[0]) and remove a
duplicate of ARRAY_SIZE. Some trailing whitespaces are also removed.

drivers/block/acsi* has been left out as it's marked BROKEN.

Signed-off-by: default avatarTobias Klauser <tklauser@nuerscht.ch>
Cc: Jens Axboe <axboe@suse.de>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent ef9ceab2
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3760,7 +3760,7 @@ static void DAC960_V1_ProcessCompletedCommand(DAC960_Command_T *Command)
	      if (SenseKey == DAC960_SenseKey_VendorSpecific &&
		  AdditionalSenseCode == 0x80 &&
		  AdditionalSenseCodeQualifier <
		  sizeof(DAC960_EventMessages) / sizeof(char *))
		  ARRAY_SIZE(DAC960_EventMessages))
		DAC960_Critical("Physical Device %d:%d %s\n", Controller,
				EventLogEntry->Channel,
				EventLogEntry->TargetID,
+1 −1
Original line number Diff line number Diff line
@@ -131,7 +131,7 @@ static struct fd_drive_type drive_types[] = {
{ FD_DD_5,	"DD 5.25", 40, 2, 14716, 13630, 1, 40, 81, 6, 30, 2},
{ FD_NODRIVE, "No Drive", 0, 0,     0,     0, 0,  0,  0,  0,  0, 0}
};
static int num_dr_types = sizeof(drive_types) / sizeof(drive_types[0]);
static int num_dr_types = ARRAY_SIZE(drive_types);

static int amiga_read(int), dos_read(int);
static void amiga_write(int), dos_write(int);
+1 −1
Original line number Diff line number Diff line
@@ -181,7 +181,7 @@ static struct {
	{  6, TYPE_HD },	/* 31: H1640    <- was H1600 == h1600 for PC */
};

#define NUM_DISK_MINORS (sizeof(minor2disktype)/sizeof(*minor2disktype))
#define NUM_DISK_MINORS ARRAY_SIZE(minor2disktype)

/*
 * Maximum disk size (in kilobytes). This default is used whenever the
+2 −2
Original line number Diff line number Diff line
@@ -103,7 +103,7 @@ static const struct pci_device_id cciss_pci_device_id[] = {
};
MODULE_DEVICE_TABLE(pci, cciss_pci_device_id);

#define NR_PRODUCTS (sizeof(products)/sizeof(struct board_type))
#define NR_PRODUCTS ARRAY_SIZE(products)

/*  board_id = Subsystem Device ID & Vendor ID
 *  product = Marketing Name for the board
+2 −2
Original line number Diff line number Diff line
@@ -72,7 +72,7 @@ static ctlr_info_t *hba[MAX_CTLR];

static int eisa[8];

#define NR_PRODUCTS (sizeof(products)/sizeof(struct board_type))
#define NR_PRODUCTS ARRAY_SIZE(products)

/*  board_id = Subsystem Device ID & Vendor ID
 *  product = Marketing Name for the board
Loading