Commit 440c734f authored by Joe Perches's avatar Joe Perches Committed by Linus Torvalds

qlogic: use pci_zalloc_consistent

Remove the now unnecessary memset too.
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Cc: Manish Chopra <manish.chopra@qlogic.com>
Cc: Sony Chacko <sony.chacko@qlogic.com>
Cc: Rajesh Borundia <rajesh.borundia@qlogic.com>
Cc: Shahed Shaikh <shahed.shaikh@qlogic.com>
Cc: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
Cc: Ron Mercer <ron.mercer@qlogic.com>
Acked-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent a2d0abc6
...@@ -129,14 +129,12 @@ netxen_get_minidump_template(struct netxen_adapter *adapter) ...@@ -129,14 +129,12 @@ netxen_get_minidump_template(struct netxen_adapter *adapter)
return NX_RCODE_INVALID_ARGS; return NX_RCODE_INVALID_ARGS;
} }
addr = pci_alloc_consistent(adapter->pdev, size, &md_template_addr); addr = pci_zalloc_consistent(adapter->pdev, size, &md_template_addr);
if (!addr) { if (!addr) {
dev_err(&adapter->pdev->dev, "Unable to allocate dmable memory for template.\n"); dev_err(&adapter->pdev->dev, "Unable to allocate dmable memory for template.\n");
return -ENOMEM; return -ENOMEM;
} }
memset(addr, 0, size);
memset(&cmd, 0, sizeof(cmd)); memset(&cmd, 0, sizeof(cmd));
memset(&cmd.rsp, 1, sizeof(struct _cdrp_cmd)); memset(&cmd.rsp, 1, sizeof(struct _cdrp_cmd));
cmd.req.cmd = NX_CDRP_CMD_GET_TEMP_HDR; cmd.req.cmd = NX_CDRP_CMD_GET_TEMP_HDR;
......
...@@ -2727,23 +2727,22 @@ static void ql_free_shadow_space(struct ql_adapter *qdev) ...@@ -2727,23 +2727,22 @@ static void ql_free_shadow_space(struct ql_adapter *qdev)
static int ql_alloc_shadow_space(struct ql_adapter *qdev) static int ql_alloc_shadow_space(struct ql_adapter *qdev)
{ {
qdev->rx_ring_shadow_reg_area = qdev->rx_ring_shadow_reg_area =
pci_alloc_consistent(qdev->pdev, pci_zalloc_consistent(qdev->pdev, PAGE_SIZE,
PAGE_SIZE, &qdev->rx_ring_shadow_reg_dma); &qdev->rx_ring_shadow_reg_dma);
if (qdev->rx_ring_shadow_reg_area == NULL) { if (qdev->rx_ring_shadow_reg_area == NULL) {
netif_err(qdev, ifup, qdev->ndev, netif_err(qdev, ifup, qdev->ndev,
"Allocation of RX shadow space failed.\n"); "Allocation of RX shadow space failed.\n");
return -ENOMEM; return -ENOMEM;
} }
memset(qdev->rx_ring_shadow_reg_area, 0, PAGE_SIZE);
qdev->tx_ring_shadow_reg_area = qdev->tx_ring_shadow_reg_area =
pci_alloc_consistent(qdev->pdev, PAGE_SIZE, pci_zalloc_consistent(qdev->pdev, PAGE_SIZE,
&qdev->tx_ring_shadow_reg_dma); &qdev->tx_ring_shadow_reg_dma);
if (qdev->tx_ring_shadow_reg_area == NULL) { if (qdev->tx_ring_shadow_reg_area == NULL) {
netif_err(qdev, ifup, qdev->ndev, netif_err(qdev, ifup, qdev->ndev,
"Allocation of TX shadow space failed.\n"); "Allocation of TX shadow space failed.\n");
goto err_wqp_sh_area; goto err_wqp_sh_area;
} }
memset(qdev->tx_ring_shadow_reg_area, 0, PAGE_SIZE);
return 0; return 0;
err_wqp_sh_area: err_wqp_sh_area:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment