aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/irda/smsc-ircc2.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/smsc-ircc2.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/smsc-ircc2.c')
-rw-r--r--drivers/net/irda/smsc-ircc2.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/net/irda/smsc-ircc2.c b/drivers/net/irda/smsc-ircc2.c
index 59b45c10adbc..aa05dad75335 100644
--- a/drivers/net/irda/smsc-ircc2.c
+++ b/drivers/net/irda/smsc-ircc2.c
@@ -563,19 +563,16 @@ static int smsc_ircc_open(unsigned int fir_base, unsigned int sir_base, u8 dma,
563 563
564 self->rx_buff.head = 564 self->rx_buff.head =
565 dma_alloc_coherent(NULL, self->rx_buff.truesize, 565 dma_alloc_coherent(NULL, self->rx_buff.truesize,
566 &self->rx_buff_dma, GFP_KERNEL); 566 &self->rx_buff_dma, GFP_KERNEL | __GFP_ZERO);
567 if (self->rx_buff.head == NULL) 567 if (self->rx_buff.head == NULL)
568 goto err_out2; 568 goto err_out2;
569 569
570 self->tx_buff.head = 570 self->tx_buff.head =
571 dma_alloc_coherent(NULL, self->tx_buff.truesize, 571 dma_alloc_coherent(NULL, self->tx_buff.truesize,
572 &self->tx_buff_dma, GFP_KERNEL); 572 &self->tx_buff_dma, GFP_KERNEL | __GFP_ZERO);
573 if (self->tx_buff.head == NULL) 573 if (self->tx_buff.head == NULL)
574 goto err_out3; 574 goto err_out3;
575 575
576 memset(self->rx_buff.head, 0, self->rx_buff.truesize);
577 memset(self->tx_buff.head, 0, self->tx_buff.truesize);
578
579 self->rx_buff.in_frame = FALSE; 576 self->rx_buff.in_frame = FALSE;
580 self->rx_buff.state = OUTSIDE_FRAME; 577 self->rx_buff.state = OUTSIDE_FRAME;
581 self->tx_buff.data = self->tx_buff.head; 578 self->tx_buff.data = self->tx_buff.head;