Commit f0b6539c authored by Joe Perches's avatar Joe Perches Committed by Linus Torvalds

ipw2100: use pci_zalloc_consistent

Remove the now unnecessary memset too.
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Cc: Stanislav Yakovlev <stas.yakovlev@gmail.com>
Cc: "John W. Linville" <linville@tuxdriver.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 38537b7f
...@@ -3449,8 +3449,9 @@ static int ipw2100_msg_allocate(struct ipw2100_priv *priv) ...@@ -3449,8 +3449,9 @@ static int ipw2100_msg_allocate(struct ipw2100_priv *priv)
return -ENOMEM; return -ENOMEM;
for (i = 0; i < IPW_COMMAND_POOL_SIZE; i++) { for (i = 0; i < IPW_COMMAND_POOL_SIZE; i++) {
v = pci_alloc_consistent(priv->pci_dev, v = pci_zalloc_consistent(priv->pci_dev,
sizeof(struct ipw2100_cmd_header), &p); sizeof(struct ipw2100_cmd_header),
&p);
if (!v) { if (!v) {
printk(KERN_ERR DRV_NAME ": " printk(KERN_ERR DRV_NAME ": "
"%s: PCI alloc failed for msg " "%s: PCI alloc failed for msg "
...@@ -3459,8 +3460,6 @@ static int ipw2100_msg_allocate(struct ipw2100_priv *priv) ...@@ -3459,8 +3460,6 @@ static int ipw2100_msg_allocate(struct ipw2100_priv *priv)
break; break;
} }
memset(v, 0, sizeof(struct ipw2100_cmd_header));
priv->msg_buffers[i].type = COMMAND; priv->msg_buffers[i].type = COMMAND;
priv->msg_buffers[i].info.c_struct.cmd = priv->msg_buffers[i].info.c_struct.cmd =
(struct ipw2100_cmd_header *)v; (struct ipw2100_cmd_header *)v;
...@@ -4336,16 +4335,12 @@ static int status_queue_allocate(struct ipw2100_priv *priv, int entries) ...@@ -4336,16 +4335,12 @@ static int status_queue_allocate(struct ipw2100_priv *priv, int entries)
IPW_DEBUG_INFO("enter\n"); IPW_DEBUG_INFO("enter\n");
q->size = entries * sizeof(struct ipw2100_status); q->size = entries * sizeof(struct ipw2100_status);
q->drv = q->drv = pci_zalloc_consistent(priv->pci_dev, q->size, &q->nic);
(struct ipw2100_status *)pci_alloc_consistent(priv->pci_dev,
q->size, &q->nic);
if (!q->drv) { if (!q->drv) {
IPW_DEBUG_WARNING("Can not allocate status queue.\n"); IPW_DEBUG_WARNING("Can not allocate status queue.\n");
return -ENOMEM; return -ENOMEM;
} }
memset(q->drv, 0, q->size);
IPW_DEBUG_INFO("exit\n"); IPW_DEBUG_INFO("exit\n");
return 0; return 0;
...@@ -4374,13 +4369,12 @@ static int bd_queue_allocate(struct ipw2100_priv *priv, ...@@ -4374,13 +4369,12 @@ static int bd_queue_allocate(struct ipw2100_priv *priv,
q->entries = entries; q->entries = entries;
q->size = entries * sizeof(struct ipw2100_bd); q->size = entries * sizeof(struct ipw2100_bd);
q->drv = pci_alloc_consistent(priv->pci_dev, q->size, &q->nic); q->drv = pci_zalloc_consistent(priv->pci_dev, q->size, &q->nic);
if (!q->drv) { if (!q->drv) {
IPW_DEBUG_INFO IPW_DEBUG_INFO
("can't allocate shared memory for buffer descriptors\n"); ("can't allocate shared memory for buffer descriptors\n");
return -ENOMEM; return -ENOMEM;
} }
memset(q->drv, 0, q->size);
IPW_DEBUG_INFO("exit\n"); IPW_DEBUG_INFO("exit\n");
......
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