Re: [PATCH 1/3] staging: et131x: simplify rx dma code

2013-11-27 Thread ZHAO Gang
On Wed, Nov 27, 2013 at 9:26 PM, Dan Carpenter wrote: > On Wed, Nov 27, 2013 at 08:43:57PM +0800, ZHAO Gang wrote: >> >> + /* Update the pointer */ >> >> + dma_addr += fbr->buffsize; >> > >> > Do the virt_addr update here as well. >> >

Re: [PATCH 1/3] staging: et131x: simplify rx dma code

2013-11-27 Thread ZHAO Gang
On Wed, Nov 27, 2013 at 8:04 PM, Dan Carpenter wrote: > On Wed, Nov 27, 2013 at 07:37:30PM +0800, ZHAO Gang wrote: >> On Wed, Nov 27, 2013 at 5:02 PM, Dan Carpenter >> wrote: >> > On Wed, Nov 27, 2013 at 03:45:12PM +0800, ZHAO Gang wrote: >> >> @@ -2208,8 +2204,11 @@ static int et131x_rx_dma_mem

Re: [PATCH 1/3] staging: et131x: simplify rx dma code

2013-11-27 Thread Dan Carpenter
On Wed, Nov 27, 2013 at 08:43:57PM +0800, ZHAO Gang wrote: > >> + /* Update the pointer */ > >> + dma_addr += fbr->buffsize; > > > > Do the virt_addr update here as well. > > virt_addr += fbr->buffsize; > > > >

Re: [PATCH 1/3] staging: et131x: simplify rx dma code

2013-11-27 Thread ZHAO Gang
On Wed, Nov 27, 2013 at 6:06 PM, Dan Carpenter wrote: > Ok, yeah. This patch is the right thing. I had a couple minor style > complaints. I am happy to hear this. > > On Wed, Nov 27, 2013 at 03:45:12PM +0800, ZHAO Gang wrote: >> The original code allocate rx dma memory in several dma_alloc_coh

Re: [PATCH 1/3] staging: et131x: simplify rx dma code

2013-11-27 Thread Dan Carpenter
On Wed, Nov 27, 2013 at 07:37:30PM +0800, ZHAO Gang wrote: > On Wed, Nov 27, 2013 at 5:02 PM, Dan Carpenter > wrote: > > On Wed, Nov 27, 2013 at 03:45:12PM +0800, ZHAO Gang wrote: > >> @@ -2208,8 +2204,11 @@ static int et131x_rx_dma_memory_alloc(struct > >> et131x_adapter *adapter) > >> rx

Re: [PATCH 1/3] staging: et131x: simplify rx dma code

2013-11-27 Thread ZHAO Gang
On Wed, Nov 27, 2013 at 5:02 PM, Dan Carpenter wrote: > On Wed, Nov 27, 2013 at 03:45:12PM +0800, ZHAO Gang wrote: >> @@ -2208,8 +2204,11 @@ static int et131x_rx_dma_memory_alloc(struct >> et131x_adapter *adapter) >> rx_ring = &adapter->rx_ring; >> >> /* Alloc memory for the lookup ta

Re: [PATCH 1/3] staging: et131x: simplify rx dma code

2013-11-27 Thread Dan Carpenter
Ok, yeah. This patch is the right thing. I had a couple minor style complaints. On Wed, Nov 27, 2013 at 03:45:12PM +0800, ZHAO Gang wrote: > The original code allocate rx dma memory in several dma_alloc_coherent calls, > which causes some problems: > 1. since dma_alloc_coherent allocate at least

Re: [PATCH 1/3] staging: et131x: simplify rx dma code

2013-11-27 Thread Dan Carpenter
On Wed, Nov 27, 2013 at 03:45:12PM +0800, ZHAO Gang wrote: > @@ -2208,8 +2204,11 @@ static int et131x_rx_dma_memory_alloc(struct > et131x_adapter *adapter) > rx_ring = &adapter->rx_ring; > > /* Alloc memory for the lookup table */ > - rx_ring->fbr[0] = kmalloc(sizeof(struct fbr_l

[PATCH 1/3] staging: et131x: simplify rx dma code

2013-11-26 Thread ZHAO Gang
The original code allocate rx dma memory in several dma_alloc_coherent calls, which causes some problems: 1. since dma_alloc_coherent allocate at least one page memory, it wastes some memory when allocation size is smaller than one page. 2. it causes et131x_rx_dma_memory_free as complex as et131