aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2014-08-08 17:24:38 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-08-08 18:57:29 -0400
commitf0b6539cfaa6c13c9ebaa47f0136fee7a4c2d981 (patch)
tree9406ac6f2b38bb064b6d2c9f231f5980ee6063bb /drivers/net
parent38537b7f558bca5375b87f0c75ec5cfa2ed69dab (diff)
ipw2100: use pci_zalloc_consistent
Remove the now unnecessary memset too. Signed-off-by: Joe Perches <joe@perches.com> Cc: Stanislav Yakovlev <stas.yakovlev@gmail.com> Cc: "John W. Linville" <linville@tuxdriver.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/ipw2x00/ipw2100.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/drivers/net/wireless/ipw2x00/ipw2100.c b/drivers/net/wireless/ipw2x00/ipw2100.c
index dfc6dfc56d52..1ab8e500fb77 100644
--- a/drivers/net/wireless/ipw2x00/ipw2100.c
+++ b/drivers/net/wireless/ipw2x00/ipw2100.c
@@ -3449,8 +3449,9 @@ static int ipw2100_msg_allocate(struct ipw2100_priv *priv)
3449 return -ENOMEM; 3449 return -ENOMEM;
3450 3450
3451 for (i = 0; i < IPW_COMMAND_POOL_SIZE; i++) { 3451 for (i = 0; i < IPW_COMMAND_POOL_SIZE; i++) {
3452 v = pci_alloc_consistent(priv->pci_dev, 3452 v = pci_zalloc_consistent(priv->pci_dev,
3453 sizeof(struct ipw2100_cmd_header), &p); 3453 sizeof(struct ipw2100_cmd_header),
3454 &p);
3454 if (!v) { 3455 if (!v) {
3455 printk(KERN_ERR DRV_NAME ": " 3456 printk(KERN_ERR DRV_NAME ": "
3456 "%s: PCI alloc failed for msg " 3457 "%s: PCI alloc failed for msg "
@@ -3459,8 +3460,6 @@ static int ipw2100_msg_allocate(struct ipw2100_priv *priv)
3459 break; 3460 break;
3460 } 3461 }
3461 3462
3462 memset(v, 0, sizeof(struct ipw2100_cmd_header));
3463
3464 priv->msg_buffers[i].type = COMMAND; 3463 priv->msg_buffers[i].type = COMMAND;
3465 priv->msg_buffers[i].info.c_struct.cmd = 3464 priv->msg_buffers[i].info.c_struct.cmd =
3466 (struct ipw2100_cmd_header *)v; 3465 (struct ipw2100_cmd_header *)v;
@@ -4336,16 +4335,12 @@ static int status_queue_allocate(struct ipw2100_priv *priv, int entries)
4336 IPW_DEBUG_INFO("enter\n"); 4335 IPW_DEBUG_INFO("enter\n");
4337 4336
4338 q->size = entries * sizeof(struct ipw2100_status); 4337 q->size = entries * sizeof(struct ipw2100_status);
4339 q->drv = 4338 q->drv = pci_zalloc_consistent(priv->pci_dev, q->size, &q->nic);
4340 (struct ipw2100_status *)pci_alloc_consistent(priv->pci_dev,
4341 q->size, &q->nic);
4342 if (!q->drv) { 4339 if (!q->drv) {
4343 IPW_DEBUG_WARNING("Can not allocate status queue.\n"); 4340 IPW_DEBUG_WARNING("Can not allocate status queue.\n");
4344 return -ENOMEM; 4341 return -ENOMEM;
4345 } 4342 }
4346 4343
4347 memset(q->drv, 0, q->size);
4348
4349 IPW_DEBUG_INFO("exit\n"); 4344 IPW_DEBUG_INFO("exit\n");
4350 4345
4351 return 0; 4346 return 0;
@@ -4374,13 +4369,12 @@ static int bd_queue_allocate(struct ipw2100_priv *priv,
4374 4369
4375 q->entries = entries; 4370 q->entries = entries;
4376 q->size = entries * sizeof(struct ipw2100_bd); 4371 q->size = entries * sizeof(struct ipw2100_bd);
4377 q->drv = pci_alloc_consistent(priv->pci_dev, q->size, &q->nic); 4372 q->drv = pci_zalloc_consistent(priv->pci_dev, q->size, &q->nic);
4378 if (!q->drv) { 4373 if (!q->drv) {
4379 IPW_DEBUG_INFO 4374 IPW_DEBUG_INFO
4380 ("can't allocate shared memory for buffer descriptors\n"); 4375 ("can't allocate shared memory for buffer descriptors\n");
4381 return -ENOMEM; 4376 return -ENOMEM;
4382 } 4377 }
4383 memset(q->drv, 0, q->size);
4384 4378
4385 IPW_DEBUG_INFO("exit\n"); 4379 IPW_DEBUG_INFO("exit\n");
4386 4380