|
|
3c6e85 |
From 2923b237296b70c46a0091e25c920922bc053f8b Mon Sep 17 00:00:00 2001
|
|
|
3c6e85 |
From: Himanshu Madhani <hmadhani@redhat.com>
|
|
|
3c6e85 |
Date: Thu, 1 Aug 2019 15:55:20 -0400
|
|
|
3c6e85 |
Subject: [PATCH 060/124] [scsi] scsi: qla2xxx: Use ARRAY_SIZE() in the
|
|
|
3c6e85 |
definition of QLA_LAST_SPEED
|
|
|
3c6e85 |
|
|
|
3c6e85 |
Message-id: <20190801155618.12650-61-hmadhani@redhat.com>
|
|
|
3c6e85 |
Patchwork-id: 267845
|
|
|
3c6e85 |
O-Subject: [RHEL 7.8 e-stor PATCH 060/118] scsi: qla2xxx: Use ARRAY_SIZE() in the definition of QLA_LAST_SPEED
|
|
|
3c6e85 |
Bugzilla: 1729270
|
|
|
3c6e85 |
RH-Acked-by: Jarod Wilson <jarod@redhat.com>
|
|
|
3c6e85 |
RH-Acked-by: Tony Camuso <tcamuso@redhat.com>
|
|
|
3c6e85 |
|
|
|
3c6e85 |
From: Bart Van Assche <bvanassche@acm.org>
|
|
|
3c6e85 |
|
|
|
3c6e85 |
Bugzilla 1729270
|
|
|
3c6e85 |
|
|
|
3c6e85 |
Make the code easier to read by avoiding to use a hard-coded constant. This
|
|
|
3c6e85 |
patch does not change any functionality.
|
|
|
3c6e85 |
|
|
|
3c6e85 |
Cc: Himanshu Madhani <hmadhani@marvell.com>
|
|
|
3c6e85 |
Cc: Giridhar Malavali <gmalavali@marvell.com>
|
|
|
3c6e85 |
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
|
|
|
3c6e85 |
Acked-by: Himanshu Madhani <hmadhani@marvell.com>
|
|
|
3c6e85 |
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
|
|
|
3c6e85 |
(cherry picked from commit b0a1c5b5c38ad6ee813875a28472774474d72589)
|
|
|
3c6e85 |
Signed-off-by: Himanshu Madhani <hmadhani@redhat.com>
|
|
|
3c6e85 |
Signed-off-by: Jan Stancek <jstancek@redhat.com>
|
|
|
3c6e85 |
---
|
|
|
3c6e85 |
drivers/scsi/qla2xxx/qla_isr.c | 2 +-
|
|
|
3c6e85 |
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
3c6e85 |
|
|
|
3c6e85 |
diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
|
|
|
3c6e85 |
index 779753d0238a..bac8fcdf5356 100644
|
|
|
3c6e85 |
--- a/drivers/scsi/qla2xxx/qla_isr.c
|
|
|
3c6e85 |
+++ b/drivers/scsi/qla2xxx/qla_isr.c
|
|
|
3c6e85 |
@@ -365,7 +365,7 @@ qla2x00_get_link_speed_str(struct qla_hw_data *ha, uint16_t speed)
|
|
|
3c6e85 |
static const char *const link_speeds[] = {
|
|
|
3c6e85 |
"1", "2", "?", "4", "8", "16", "32", "10"
|
|
|
3c6e85 |
};
|
|
|
3c6e85 |
-#define QLA_LAST_SPEED 7
|
|
|
3c6e85 |
+#define QLA_LAST_SPEED (ARRAY_SIZE(link_speeds) - 1)
|
|
|
3c6e85 |
|
|
|
3c6e85 |
if (IS_QLA2100(ha) || IS_QLA2200(ha))
|
|
|
3c6e85 |
return link_speeds[0];
|
|
|
3c6e85 |
--
|
|
|
3c6e85 |
2.13.6
|
|
|
3c6e85 |
|