x86: PAT: fixed checkpatch errors (and whitespaces)
x86: PAT: fixed checkpatch errors (and whitespaces) Signed-off-by: Andreas Herrmann <andreas.herrmann3@amd.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
committed by
Ingo Molnar
parent
97cfab6ac4
commit
cd7a4e936d
@@ -1,9 +1,7 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Routines to indentify additional cpu features that are scattered in
|
* Routines to indentify additional cpu features that are scattered in
|
||||||
* cpuid space.
|
* cpuid space.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <linux/cpu.h>
|
#include <linux/cpu.h>
|
||||||
|
|
||||||
#include <asm/pat.h>
|
#include <asm/pat.h>
|
||||||
|
@@ -66,7 +66,7 @@ enum {
|
|||||||
PAT_UC_MINUS = 7, /* UC, but can be overriden by MTRR */
|
PAT_UC_MINUS = 7, /* UC, but can be overriden by MTRR */
|
||||||
};
|
};
|
||||||
|
|
||||||
#define PAT(x,y) ((u64)PAT_ ## y << ((x)*8))
|
#define PAT(x, y) ((u64)PAT_ ## y << ((x)*8))
|
||||||
|
|
||||||
void pat_init(void)
|
void pat_init(void)
|
||||||
{
|
{
|
||||||
@@ -100,8 +100,8 @@ void pat_init(void)
|
|||||||
* 011 UC _PAGE_CACHE_UC
|
* 011 UC _PAGE_CACHE_UC
|
||||||
* PAT bit unused
|
* PAT bit unused
|
||||||
*/
|
*/
|
||||||
pat = PAT(0,WB) | PAT(1,WC) | PAT(2,UC_MINUS) | PAT(3,UC) |
|
pat = PAT(0, WB) | PAT(1, WC) | PAT(2, UC_MINUS) | PAT(3, UC) |
|
||||||
PAT(4,WB) | PAT(5,WC) | PAT(6,UC_MINUS) | PAT(7,UC);
|
PAT(4, WB) | PAT(5, WC) | PAT(6, UC_MINUS) | PAT(7, UC);
|
||||||
|
|
||||||
/* Boot CPU check */
|
/* Boot CPU check */
|
||||||
if (!boot_pat_state)
|
if (!boot_pat_state)
|
||||||
@@ -117,11 +117,11 @@ void pat_init(void)
|
|||||||
static char *cattr_name(unsigned long flags)
|
static char *cattr_name(unsigned long flags)
|
||||||
{
|
{
|
||||||
switch (flags & _PAGE_CACHE_MASK) {
|
switch (flags & _PAGE_CACHE_MASK) {
|
||||||
case _PAGE_CACHE_UC: return "uncached";
|
case _PAGE_CACHE_UC: return "uncached";
|
||||||
case _PAGE_CACHE_UC_MINUS: return "uncached-minus";
|
case _PAGE_CACHE_UC_MINUS: return "uncached-minus";
|
||||||
case _PAGE_CACHE_WB: return "write-back";
|
case _PAGE_CACHE_WB: return "write-back";
|
||||||
case _PAGE_CACHE_WC: return "write-combining";
|
case _PAGE_CACHE_WC: return "write-combining";
|
||||||
default: return "broken";
|
default: return "broken";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -536,11 +536,11 @@ int phys_mem_access_prot_allowed(struct file *file, unsigned long pfn,
|
|||||||
* we maintain the tradition of paranoia in this code.
|
* we maintain the tradition of paranoia in this code.
|
||||||
*/
|
*/
|
||||||
if (!pat_wc_enabled &&
|
if (!pat_wc_enabled &&
|
||||||
! ( boot_cpu_has(X86_FEATURE_MTRR) ||
|
!(boot_cpu_has(X86_FEATURE_MTRR) ||
|
||||||
boot_cpu_has(X86_FEATURE_K6_MTRR) ||
|
boot_cpu_has(X86_FEATURE_K6_MTRR) ||
|
||||||
boot_cpu_has(X86_FEATURE_CYRIX_ARR) ||
|
boot_cpu_has(X86_FEATURE_CYRIX_ARR) ||
|
||||||
boot_cpu_has(X86_FEATURE_CENTAUR_MCR)) &&
|
boot_cpu_has(X86_FEATURE_CENTAUR_MCR)) &&
|
||||||
(pfn << PAGE_SHIFT) >= __pa(high_memory)) {
|
(pfn << PAGE_SHIFT) >= __pa(high_memory)) {
|
||||||
flags = _PAGE_CACHE_UC;
|
flags = _PAGE_CACHE_UC;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -562,7 +562,7 @@ int phys_mem_access_prot_allowed(struct file *file, unsigned long pfn,
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (pfn <= max_pfn_mapped &&
|
if (pfn <= max_pfn_mapped &&
|
||||||
ioremap_change_attr((unsigned long)__va(offset), size, flags) < 0) {
|
ioremap_change_attr((unsigned long)__va(offset), size, flags) < 0) {
|
||||||
free_memtype(offset, offset + size);
|
free_memtype(offset, offset + size);
|
||||||
printk(KERN_INFO
|
printk(KERN_INFO
|
||||||
"%s:%d /dev/mem ioremap_change_attr failed %s for %Lx-%Lx\n",
|
"%s:%d /dev/mem ioremap_change_attr failed %s for %Lx-%Lx\n",
|
||||||
@@ -600,4 +600,3 @@ void unmap_devmem(unsigned long pfn, unsigned long size, pgprot_t vma_prot)
|
|||||||
|
|
||||||
free_memtype(addr, addr + size);
|
free_memtype(addr, addr + size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
|
|
||||||
#ifndef _ASM_PAT_H
|
#ifndef _ASM_PAT_H
|
||||||
#define _ASM_PAT_H 1
|
#define _ASM_PAT_H
|
||||||
|
|
||||||
#include <linux/types.h>
|
#include <linux/types.h>
|
||||||
|
|
||||||
@@ -8,7 +7,7 @@
|
|||||||
extern int pat_wc_enabled;
|
extern int pat_wc_enabled;
|
||||||
extern void validate_pat_support(struct cpuinfo_x86 *c);
|
extern void validate_pat_support(struct cpuinfo_x86 *c);
|
||||||
#else
|
#else
|
||||||
static const int pat_wc_enabled = 0;
|
static const int pat_wc_enabled;
|
||||||
static inline void validate_pat_support(struct cpuinfo_x86 *c) { }
|
static inline void validate_pat_support(struct cpuinfo_x86 *c) { }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -21,4 +20,3 @@ extern int free_memtype(u64 start, u64 end);
|
|||||||
extern void pat_disable(char *reason);
|
extern void pat_disable(char *reason);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user