diff options
| author | Colin Ian King <colin.king@canonical.com> | 2019-03-27 14:11:03 -0400 |
|---|---|---|
| committer | Martin K. Petersen <martin.petersen@oracle.com> | 2019-03-29 10:02:51 -0400 |
| commit | 872e192fab643887f143106eb56443d87e5e87c1 (patch) | |
| tree | 7221e8e783094a106fcabf1695a0dee1c3cdab92 | |
| parent | d6e2635b9cf7982102750c5d9e4ba1474afa0981 (diff) | |
scsi: qedi: remove declaration of nvm_image from stack
The nvm_image is a large struct qedi_nvm_iscsi_image object of over 24K so
don't declare it on the stack just for a sizeof requirement; use sizeof on
struct qedi_nvm_iscsi_image instead.
Fixes: c77a2fa3ff8f ("scsi: qedi: Add the CRC size within iSCSI NVM image")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Manish Rangankar <mrangankar@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
| -rw-r--r-- | drivers/scsi/qedi/qedi_main.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/scsi/qedi/qedi_main.c b/drivers/scsi/qedi/qedi_main.c index e74a62448ba4..e5db9a9954dc 100644 --- a/drivers/scsi/qedi/qedi_main.c +++ b/drivers/scsi/qedi/qedi_main.c | |||
| @@ -1392,10 +1392,8 @@ static void qedi_free_nvm_iscsi_cfg(struct qedi_ctx *qedi) | |||
| 1392 | 1392 | ||
| 1393 | static int qedi_alloc_nvm_iscsi_cfg(struct qedi_ctx *qedi) | 1393 | static int qedi_alloc_nvm_iscsi_cfg(struct qedi_ctx *qedi) |
| 1394 | { | 1394 | { |
| 1395 | struct qedi_nvm_iscsi_image nvm_image; | ||
| 1396 | |||
| 1397 | qedi->iscsi_image = dma_alloc_coherent(&qedi->pdev->dev, | 1395 | qedi->iscsi_image = dma_alloc_coherent(&qedi->pdev->dev, |
| 1398 | sizeof(nvm_image), | 1396 | sizeof(struct qedi_nvm_iscsi_image), |
| 1399 | &qedi->nvm_buf_dma, GFP_KERNEL); | 1397 | &qedi->nvm_buf_dma, GFP_KERNEL); |
| 1400 | if (!qedi->iscsi_image) { | 1398 | if (!qedi->iscsi_image) { |
| 1401 | QEDI_ERR(&qedi->dbg_ctx, "Could not allocate NVM BUF.\n"); | 1399 | QEDI_ERR(&qedi->dbg_ctx, "Could not allocate NVM BUF.\n"); |
| @@ -2236,14 +2234,13 @@ static void qedi_boot_release(void *data) | |||
| 2236 | static int qedi_get_boot_info(struct qedi_ctx *qedi) | 2234 | static int qedi_get_boot_info(struct qedi_ctx *qedi) |
| 2237 | { | 2235 | { |
| 2238 | int ret = 1; | 2236 | int ret = 1; |
| 2239 | struct qedi_nvm_iscsi_image nvm_image; | ||
| 2240 | 2237 | ||
| 2241 | QEDI_INFO(&qedi->dbg_ctx, QEDI_LOG_INFO, | 2238 | QEDI_INFO(&qedi->dbg_ctx, QEDI_LOG_INFO, |
| 2242 | "Get NVM iSCSI CFG image\n"); | 2239 | "Get NVM iSCSI CFG image\n"); |
| 2243 | ret = qedi_ops->common->nvm_get_image(qedi->cdev, | 2240 | ret = qedi_ops->common->nvm_get_image(qedi->cdev, |
| 2244 | QED_NVM_IMAGE_ISCSI_CFG, | 2241 | QED_NVM_IMAGE_ISCSI_CFG, |
| 2245 | (char *)qedi->iscsi_image, | 2242 | (char *)qedi->iscsi_image, |
| 2246 | sizeof(nvm_image)); | 2243 | sizeof(struct qedi_nvm_iscsi_image)); |
| 2247 | if (ret) | 2244 | if (ret) |
| 2248 | QEDI_ERR(&qedi->dbg_ctx, | 2245 | QEDI_ERR(&qedi->dbg_ctx, |
| 2249 | "Could not get NVM image. ret = %d\n", ret); | 2246 | "Could not get NVM image. ret = %d\n", ret); |
