On 4/4/19, 12:45 PM, "[email protected] on behalf of Bart Van 
Assche" <[email protected] on behalf of [email protected]> 
wrote:

    Make the code easier to read by avoiding to use a hard-coded constant. This
    patch does not change any functionality.
    
    Cc: Himanshu Madhani <[email protected]>
    Cc: Giridhar Malavali <[email protected]>
    Signed-off-by: Bart Van Assche <[email protected]>
    ---
     drivers/scsi/qla2xxx/qla_isr.c | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    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];
    -- 
    2.21.0.196.g041f5ea1cf98
    
Looks Good.
 
Acked-by: Himanshu Madhani <[email protected]> 

Reply via email to