diff options
author | Tobias Klauser <tklauser@nuerscht.ch> | 2006-06-09 01:23:48 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2006-06-10 11:45:30 -0400 |
commit | 6391a11375de5e2bb1eb8481e54619761dc65d9f (patch) | |
tree | 956aae1d278a3f731b2e6148ff40a69aa7957ea8 /drivers/scsi/scsi_transport_sas.c | |
parent | 9dc399de0840a478adb71278becf598d3ab3aacc (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_sas.c')
-rw-r--r-- | drivers/scsi/scsi_transport_sas.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/scsi/scsi_transport_sas.c b/drivers/scsi/scsi_transport_sas.c index 8b6d65e21bae..ce4f806bd8ec 100644 --- a/drivers/scsi/scsi_transport_sas.c +++ b/drivers/scsi/scsi_transport_sas.c | |||
@@ -65,7 +65,7 @@ get_sas_##title##_names(u32 table_key, char *buf) \ | |||
65 | ssize_t len = 0; \ | 65 | ssize_t len = 0; \ |
66 | int i; \ | 66 | int i; \ |
67 | \ | 67 | \ |
68 | for (i = 0; i < sizeof(table)/sizeof(table[0]); i++) { \ | 68 | for (i = 0; i < ARRAY_SIZE(table); i++) { \ |
69 | if (table[i].value & table_key) { \ | 69 | if (table[i].value & table_key) { \ |
70 | len += sprintf(buf + len, "%s%s", \ | 70 | len += sprintf(buf + len, "%s%s", \ |
71 | prefix, table[i].name); \ | 71 | prefix, table[i].name); \ |
@@ -83,7 +83,7 @@ get_sas_##title##_names(u32 table_key, char *buf) \ | |||
83 | ssize_t len = 0; \ | 83 | ssize_t len = 0; \ |
84 | int i; \ | 84 | int i; \ |
85 | \ | 85 | \ |
86 | for (i = 0; i < sizeof(table)/sizeof(table[0]); i++) { \ | 86 | for (i = 0; i < ARRAY_SIZE(table); i++) { \ |
87 | if (table[i].value == table_key) { \ | 87 | if (table[i].value == table_key) { \ |
88 | len += sprintf(buf + len, "%s", \ | 88 | len += sprintf(buf + len, "%s", \ |
89 | table[i].name); \ | 89 | table[i].name); \ |