Blob Blame History Raw
From: Bart Van Assche <bvanassche@acm.org>
Date: Thu, 4 Apr 2019 12:44:41 -0700
Subject: scsi: qla2xxx: Use ARRAY_SIZE() in the definition of QLA_LAST_SPEED
Patch-mainline: v5.2-rc1
Git-commit: b0a1c5b5c38ad6ee813875a28472774474d72589
References: bsc#1082635 bsc#1123034 bsc#1131304 bsc#1127988 bsc#1141340 bsc#1143706

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>
Acked-by: Daniel Wagner <dwagner@suse.de>
---
 drivers/scsi/qla2xxx/qla_isr.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- 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
 	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];