aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/irda/via-ircc.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2013-03-15 03:23:58 -0400
committerDavid S. Miller <davem@davemloft.net>2013-03-17 12:50:24 -0400
commit1f9061d27d3d2028805549c4a306324a48209057 (patch)
tree7cfb1a92933f5a9bba6745b68b6a964d9e757ef9 /drivers/net/irda/via-ircc.c
parent7f9421c264f8a6e6137027a45ae576517f66fa56 (diff)
drivers:net: dma_alloc_coherent: use __GFP_ZERO instead of memset(, 0)
Reduce the number of calls required to alloc a zeroed block of memory. Trivially reduces overall object size. Other changes around these removals o Neaten call argument alignment o Remove an unnecessary OOM message after dma_alloc_coherent failure o Remove unnecessary gfp_t stack variable Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/irda/via-ircc.c')
-rw-r--r--drivers/net/irda/via-ircc.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/net/irda/via-ircc.c b/drivers/net/irda/via-ircc.c
index f9033c6a888c..51f2bc376101 100644
--- a/drivers/net/irda/via-ircc.c
+++ b/drivers/net/irda/via-ircc.c
@@ -364,21 +364,19 @@ static int via_ircc_open(struct pci_dev *pdev, chipio_t *info, unsigned int id)
364 /* Allocate memory if needed */ 364 /* Allocate memory if needed */
365 self->rx_buff.head = 365 self->rx_buff.head =
366 dma_alloc_coherent(&pdev->dev, self->rx_buff.truesize, 366 dma_alloc_coherent(&pdev->dev, self->rx_buff.truesize,
367 &self->rx_buff_dma, GFP_KERNEL); 367 &self->rx_buff_dma, GFP_KERNEL | __GFP_ZERO);
368 if (self->rx_buff.head == NULL) { 368 if (self->rx_buff.head == NULL) {
369 err = -ENOMEM; 369 err = -ENOMEM;
370 goto err_out2; 370 goto err_out2;
371 } 371 }
372 memset(self->rx_buff.head, 0, self->rx_buff.truesize);
373 372
374 self->tx_buff.head = 373 self->tx_buff.head =
375 dma_alloc_coherent(&pdev->dev, self->tx_buff.truesize, 374 dma_alloc_coherent(&pdev->dev, self->tx_buff.truesize,
376 &self->tx_buff_dma, GFP_KERNEL); 375 &self->tx_buff_dma, GFP_KERNEL | __GFP_ZERO);
377 if (self->tx_buff.head == NULL) { 376 if (self->tx_buff.head == NULL) {
378 err = -ENOMEM; 377 err = -ENOMEM;
379 goto err_out3; 378 goto err_out3;
380 } 379 }
381 memset(self->tx_buff.head, 0, self->tx_buff.truesize);
382 380
383 self->rx_buff.in_frame = FALSE; 381 self->rx_buff.in_frame = FALSE;
384 self->rx_buff.state = OUTSIDE_FRAME; 382 self->rx_buff.state = OUTSIDE_FRAME;