Re: [PATCH v2 3/4] mtrr, x86: Clean up mtrr_type_lookup()

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

 



On Fri, 2015-03-13 at 12:37 +0000, Ingo Molnar wrote:
> * Toshi Kani <toshi.kani@xxxxxx> wrote:
 :
> > +	/* Look in fixed ranges. Just return the type as per start */
> > +	if (mtrr_state.have_fixed && (start < 0x100000)) {
> > +		int idx;
> > +
> > +		if (start < 0x80000) {
> > +			idx = 0;
> > +			idx += (start >> 16);
> > +			return mtrr_state.fixed_ranges[idx];
> > +		} else if (start < 0xC0000) {
> > +			idx = 1 * 8;
> > +			idx += ((start - 0x80000) >> 14);
> > +			return mtrr_state.fixed_ranges[idx];
> > +		} else {
> > +			idx = 3 * 8;
> > +			idx += ((start - 0xC0000) >> 12);
> > +			return mtrr_state.fixed_ranges[idx];
> > +		}
> > +	}
> 
> So why not put this into a separate helper function - named 
> mtrr_type_lookup_fixed()? It has little relation to variable ranges.

Sounds good.  I will update as suggested.

> > +
> > +	/*
> > +	 * Look in variable ranges
> > +	 * Look of multiple ranges matching this address and pick type
> > +	 * as per MTRR precedence
> > +	 */
> > +	if (!(mtrr_state.enabled & 2))
> > +		return mtrr_state.def_type;
> > +
> >  	type = __mtrr_type_lookup(start, end, &partial_end, &repeat);
> 
> And this then should be named mtrr_type_lookup_variable() or so?

Will do as well.

I will send out a new version today since I won't be able to update the
patchset next week. 

Thanks,
-Toshi

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>




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