unsigned long actual_type;
int err = 0;
- /* Only track when pat_enabled */
+ BUG_ON(start >= end); /* end is exclusive */
+
if (!pat_enabled) {
/* This is identical to page table setting without PAT */
if (new_type) {
*/
u8 mtrr_type = mtrr_type_lookup(start, end);
- if (mtrr_type == MTRR_TYPE_WRBACK) {
- req_type = _PAGE_CACHE_WB;
+ if (mtrr_type == MTRR_TYPE_WRBACK)
actual_type = _PAGE_CACHE_WB;
- } else {
- req_type = _PAGE_CACHE_UC_MINUS;
+ else
actual_type = _PAGE_CACHE_UC_MINUS;
- }
- } else {
- req_type &= _PAGE_CACHE_MASK;
- actual_type = pat_x_mtrr_type(start, end, req_type);
- }
+ } else
+ actual_type = pat_x_mtrr_type(start, end,
+ req_type & _PAGE_CACHE_MASK);
new = kmalloc(sizeof(struct memtype), GFP_KERNEL);
if (!new)
struct memtype *entry;
int err = -EINVAL;
- /* Only track when pat_enabled */
- if (!pat_enabled) {
+ if (!pat_enabled)
return 0;
- }
/* Low ISA region is always mapped WB. No need to track */
if (is_ISA_range(start, end - 1))