Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1270776

Re: [PATCH 7/7] mm/mmzone: refactor memmap_valid_within

From Yaowei Bai <baiyaowei@cmss.chinamobile.com>
Newsgroups linux.kernel
Subject Re: [PATCH 7/7] mm/mmzone: refactor memmap_valid_within
Date 2015-11-17 03:50 +0100
Message-ID <qvEvf-7jH-9@gated-at.bofh.it> (permalink)
References <qvlVD-3Sn-3@gated-at.bofh.it> <qvlVD-3Sn-1@gated-at.bofh.it> <qvrom-7n2-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, Nov 16, 2015 at 01:45:01PM +0100, Michal Hocko wrote:
> On Mon 16-11-15 14:51:26, Yaowei Bai wrote:
> [...]
> > @@ -72,16 +72,10 @@ struct zoneref *next_zones_zonelist(struct zoneref *z,
> >  }
> >  
> >  #ifdef CONFIG_ARCH_HAS_HOLES_MEMORYMODEL
> > -int memmap_valid_within(unsigned long pfn,
> > +bool memmap_valid_within(unsigned long pfn,
> >  					struct page *page, struct zone *zone)
> >  {
> > -	if (page_to_pfn(page) != pfn)
> > -		return 0;
> > -
> > -	if (page_zone(page) != zone)
> > -		return 0;
> > -
> > -	return 1;
> > +	return page_to_pfn(page) == pfn && page_zone(page) == zone;
> 
> I do not think this is easier to read. Quite contrary

OK, so we can just make it return ture/false without refactoring it.

> 
> >  }
> >  #endif /* CONFIG_ARCH_HAS_HOLES_MEMORYMODEL */
> >  
> > -- 
> > 1.9.1
> > 
> > 
> 
> -- 
> Michal Hocko
> SUSE Labs


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Re: [PATCH 7/7] mm/mmzone: refactor memmap_valid_within Michal Hocko <mhocko@kernel.org> - 2015-11-16 13:50 +0100
  Re: [PATCH 7/7] mm/mmzone: refactor memmap_valid_within Yaowei Bai <baiyaowei@cmss.chinamobile.com> - 2015-11-17 03:50 +0100

csiph-web