diff --git a/drivers/scsi/mvumi.c b/drivers/scsi/mvumi.c index b3dcb8918618..60c65586f30e 100644 --- a/drivers/scsi/mvumi.c +++ b/drivers/scsi/mvumi.c @@ -1841,7 +1841,7 @@ static enum mvumi_qc_result mvumi_send_command(struct mvumi_hba *mhba, cmd->frame->request_id = mhba->io_seq++; cmd->request_id = cmd->frame->request_id; mhba->tag_cmd[cmd->frame->tag] = cmd; - frame_len = sizeof(*ib_frame) - 4 + + frame_len = sizeof(*ib_frame) + ib_frame->sg_counts * sizeof(struct mvumi_sgl); if (mhba->hba_capability & HS_CAPABILITY_SUPPORT_DYN_SRC) { struct mvumi_dyn_list_entry *dle; @@ -2387,7 +2387,7 @@ static int mvumi_io_attach(struct mvumi_hba *mhba) struct Scsi_Host *host = mhba->shost; struct scsi_device *sdev = NULL; int ret; - unsigned int max_sg = (mhba->ib_max_size + 4 - + unsigned int max_sg = (mhba->ib_max_size - sizeof(struct mvumi_msg_frame)) / sizeof(struct mvumi_sgl); host->irq = mhba->pdev->irq; diff --git a/drivers/scsi/mvumi.h b/drivers/scsi/mvumi.h index a88c58787b68..1306a4abf19a 100644 --- a/drivers/scsi/mvumi.h +++ b/drivers/scsi/mvumi.h @@ -279,7 +279,7 @@ struct mvumi_msg_frame { u16 request_id; u16 reserved1; u8 cdb[MAX_COMMAND_SIZE]; - u32 payload[1]; + u32 payload[]; }; /* @@ -294,7 +294,7 @@ struct mvumi_rsp_frame { u8 req_status; u8 rsp_flag; /* Indicates the type of Data_Payload.*/ u16 request_id; - u32 payload[1]; + u32 payload[]; }; struct mvumi_ob_data { @@ -380,7 +380,7 @@ struct mvumi_hs_header { u8 page_code; u8 checksum; u16 frame_length; - u32 frame_content[1]; + u32 frame_content[]; }; /*