On Fri, Dec 06, 2013 at 09:35:02PM +0800, ZHAO Gang wrote:
> Signed-off-by: ZHAO Gang <gamer...@gmail.com>
> ---
>  drivers/staging/et131x/et131x.c | 33 +++++++++++++++++----------------
>  1 file changed, 17 insertions(+), 16 deletions(-)
> 
> diff --git a/drivers/staging/et131x/et131x.c b/drivers/staging/et131x/et131x.c
> index 17ac711..b6ce68e 100644
> --- a/drivers/staging/et131x/et131x.c
> +++ b/drivers/staging/et131x/et131x.c
> @@ -2361,6 +2361,7 @@ static void et131x_rx_dma_memory_free(struct 
> et131x_adapter *adapter)
>       u32 pktstat_ringsize;
>       struct rfd *rfd;
>       struct rx_ring *rx_ring;
> +     struct fbr_lookup *fbr;
>  
>       /* Setup some convenience pointers */
>       rx_ring = &adapter->rx_ring;
> @@ -2379,34 +2380,34 @@ static void et131x_rx_dma_memory_free(struct 
> et131x_adapter *adapter)
>  
>       /* Free Free Buffer Rings */
>       for (id = 0; id < NUM_FBRS; id++) {
> -             if (!rx_ring->fbr[id]->ring_virtaddr)
> +             fbr = rx_ring->fbr[id];
> +
> +             if (!fbr->ring_virtaddr)
>                       continue;
>  
>               /* First the packet memory */
> -             for (index = 0;
> -                  index < (rx_ring->fbr[id]->num_entries / FBR_CHUNKS);
> +             for (index = 0; index < fbr->num_entries / FBR_CHUNKS;
>                    index++) {

Either fit the whole for statement on one line (if possible), or keep it
as one part per line, as it was. Your change is less readable.

> -                     if (rx_ring->fbr[id]->mem_virtaddrs[index]) {
> -                             bufsize =
> -                                 rx_ring->fbr[id]->buffsize * FBR_CHUNKS;
> +                     if (fbr->mem_virtaddrs[index]) {
> +                             bufsize = fbr->buffsize * FBR_CHUNKS;
>  
>                               dma_free_coherent(&adapter->pdev->dev,
> -                                     bufsize,
> -                                     rx_ring->fbr[id]->mem_virtaddrs[index],
> -                                     rx_ring->fbr[id]->mem_physaddrs[index]);
> +                                               bufsize,
> +                                               fbr->mem_virtaddrs[index],
> +                                               fbr->mem_physaddrs[index]);
>  
> -                             rx_ring->fbr[id]->mem_virtaddrs[index] = NULL;
> +                             fbr->mem_virtaddrs[index] = NULL;
>                       }
>               }
>  
> -             bufsize =
> -                 sizeof(struct fbr_desc) * rx_ring->fbr[id]->num_entries;
> +             bufsize = sizeof(struct fbr_desc) * fbr->num_entries;
>  
> -             dma_free_coherent(&adapter->pdev->dev, bufsize,
> -                                 rx_ring->fbr[id]->ring_virtaddr,
> -                                 rx_ring->fbr[id]->ring_physaddr);
> +             dma_free_coherent(&adapter->pdev->dev,
> +                               bufsize,
> +                               fbr->ring_virtaddr,
> +                               fbr->ring_physaddr);

You've done the right thing here. The rest of the patch is good - just
the issue above.

Cheers,

Mark

_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to