diff options
author | Bart Van Assche <bvanassche@acm.org> | 2019-04-04 12:44:41 -0700 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2019-04-08 22:16:34 -0400 |
commit | b0a1c5b5c38ad6ee813875a28472774474d72589 (patch) | |
tree | 7967286d5176c6f306591d79c8741b49c171d2de /drivers/scsi/qla2xxx/qla_isr.c | |
parent | abe5706dcf47cfdf0b929fff727279614df3c263 (diff) | |
download | linux-stable-b0a1c5b5c38ad6ee813875a28472774474d72589.tar.gz linux-stable-b0a1c5b5c38ad6ee813875a28472774474d72589.tar.bz2 linux-stable-b0a1c5b5c38ad6ee813875a28472774474d72589.zip |
scsi: qla2xxx: Use ARRAY_SIZE() in the definition of QLA_LAST_SPEED
Make the code easier to read by avoiding to use a hard-coded constant. This
patch does not change any functionality.
Cc: Himanshu Madhani <hmadhani@marvell.com>
Cc: Giridhar Malavali <gmalavali@marvell.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Acked-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_isr.c')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_isr.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c index 20f0761b8b87..055d313a0461 100644 --- a/drivers/scsi/qla2xxx/qla_isr.c +++ b/drivers/scsi/qla2xxx/qla_isr.c @@ -366,7 +366,7 @@ qla2x00_get_link_speed_str(struct qla_hw_data *ha, uint16_t speed) static const char *const link_speeds[] = { "1", "2", "?", "4", "8", "16", "32", "10" }; -#define QLA_LAST_SPEED 7 +#define QLA_LAST_SPEED (ARRAY_SIZE(link_speeds) - 1) if (IS_QLA2100(ha) || IS_QLA2200(ha)) return link_speeds[0]; |