Re: [PATCH v1] mm/dmapool.c: Replace open-coded list_first_entry()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Aug 12, 2020 at 07:41:41PM +0100, Matthew Wilcox wrote:
> On Wed, Aug 12, 2020 at 06:30:59PM +0300, Andy Shevchenko wrote:
> >  	while (!list_empty(&pool->page_list)) {
> >  		struct dma_page *page;
> > -		page = list_entry(pool->page_list.next,
> > -				  struct dma_page, page_list);
> > +
> > +		page = list_first_entry(&pool->page_list, struct dma_page, page_list);
> 
> Eh, I'd rather see this as:
> 
> 		struct dma_page *page = list_first_entry(&pool->page_list,
> 				struct dma_page, page_list);

On the second thought we may convert the entire loop to use
list_for_each_entry_safe() since there is no locking in between, we
should be fine.

-- 
With Best Regards,
Andy Shevchenko






[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux