qla2xxx: Avoid using variable-length arrays
authorBart Van Assche <bart.vanassche@sandisk.com>
Fri, 20 Jan 2017 21:31:13 +0000 (13:31 -0800)
committerNicholas Bellinger <nab@linux-iscsi.org>
Thu, 9 Feb 2017 08:39:04 +0000 (00:39 -0800)
This patch does not change any functionality but avoids that sparse
complains about using variable-length arrays.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Acked-by: Himanshu Madhani <himanshu.madhani@cavium.com>
Cc: Quinn Tran <quinn.tran@cavium.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/scsi/qla2xxx/qla_os.c

index 191aa94dc2f13947c284d777fdec981bbcfb11ed..4f5965281395f40fab9630a9bcf422a83b58c0d3 100644 (file)
@@ -4272,8 +4272,8 @@ struct scsi_qla_host *qla2x00_create_host(struct scsi_host_template *sht,
        spin_lock_init(&vha->cmd_list_lock);
        init_waitqueue_head(&vha->fcport_waitQ);
 
-       vha->gnl.size =
-           sizeof(struct get_name_list_extended[ha->max_loop_id+1]);
+       vha->gnl.size = sizeof(struct get_name_list_extended) *
+                       (ha->max_loop_id + 1);
        vha->gnl.l = dma_alloc_coherent(&ha->pdev->dev,
            vha->gnl.size, &vha->gnl.ldma, GFP_KERNEL);
        if (!vha->gnl.l) {