aboutsummaryrefslogtreecommitdiff
path: root/drivers/scsi/scsi_transport_fc.c
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@nuerscht.ch>2006-06-08 22:23:48 -0700
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-06-10 10:45:30 -0500
commit6391a11375de5e2bb1eb8481e54619761dc65d9f (patch)
tree956aae1d278a3f731b2e6148ff40a69aa7957ea8 /drivers/scsi/scsi_transport_fc.c
parent9dc399de0840a478adb71278becf598d3ab3aacc (diff)
[SCSI] drivers/scsi: Use ARRAY_SIZE macro
Use ARRAY_SIZE macro instead of sizeof(x)/sizeof(x[0]) and remove duplicates of the macro. Signed-off-by: Tobias Klauser <tklauser@nuerscht.ch> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/scsi_transport_fc.c')
-rw-r--r--drivers/scsi/scsi_transport_fc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport_fc.c
index 95c5478dcdf..f2db7a41cf1 100644
--- a/drivers/scsi/scsi_transport_fc.c
+++ b/drivers/scsi/scsi_transport_fc.c
@@ -50,7 +50,7 @@ static const char *get_fc_##title##_name(enum table_type table_key) \
int i; \
char *name = NULL; \
\
- for (i = 0; i < sizeof(table)/sizeof(table[0]); i++) { \
+ for (i = 0; i < ARRAY_SIZE(table); i++) { \
if (table[i].value == table_key) { \
name = table[i].name; \
break; \
@@ -65,7 +65,7 @@ static int get_fc_##title##_match(const char *table_key, \
{ \
int i; \
\
- for (i = 0; i < sizeof(table)/sizeof(table[0]); i++) { \
+ for (i = 0; i < ARRAY_SIZE(table); i++) { \
if (strncmp(table_key, table[i].name, \
table[i].matchlen) == 0) { \
*value = table[i].value; \
@@ -140,7 +140,7 @@ get_fc_##title##_names(u32 table_key, char *buf) \
ssize_t len = 0; \
int i; \
\
- for (i = 0; i < sizeof(table)/sizeof(table[0]); i++) { \
+ for (i = 0; i < ARRAY_SIZE(table); i++) { \
if (table[i].value & table_key) { \
len += sprintf(buf + len, "%s%s", \
prefix, table[i].name); \