diff options
author | Borislav Petkov <bp@amd64.org> | 2011-03-03 06:59:32 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2011-03-03 07:06:20 -0500 |
commit | 84fd1d35cc868a4f7590b6dbdae2d7761287b97a (patch) | |
tree | 11960a858330628e3278ca16f4eab9c663dc7267 /arch/x86 | |
parent | 9e81509efc4fefcdd75cc6a4121672fa71ae8745 (diff) |
x86, amd-nb: Misc cleanliness fixes
Make functions used strictly in bool context return bool. Also,
fixup used types and comments, and make a local function static,
while at it.
Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
Cc: Borislav Petkov <bp@amd64.org>
LKML-Reference: <20110303115932.GA8603@aftab>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/include/asm/amd_nb.h | 12 | ||||
-rw-r--r-- | arch/x86/kernel/amd_nb.c | 18 |
2 files changed, 16 insertions, 14 deletions
diff --git a/arch/x86/include/asm/amd_nb.h b/arch/x86/include/asm/amd_nb.h index 2b33c4df979f..527fb966ab5c 100644 --- a/arch/x86/include/asm/amd_nb.h +++ b/arch/x86/include/asm/amd_nb.h | |||
@@ -13,7 +13,7 @@ extern const struct pci_device_id amd_nb_misc_ids[]; | |||
13 | extern const struct amd_nb_bus_dev_range amd_nb_bus_dev_ranges[]; | 13 | extern const struct amd_nb_bus_dev_range amd_nb_bus_dev_ranges[]; |
14 | struct bootnode; | 14 | struct bootnode; |
15 | 15 | ||
16 | extern int early_is_amd_nb(u32 value); | 16 | extern bool early_is_amd_nb(u32 value); |
17 | extern int amd_cache_northbridges(void); | 17 | extern int amd_cache_northbridges(void); |
18 | extern void amd_flush_garts(void); | 18 | extern void amd_flush_garts(void); |
19 | extern int amd_numa_init(unsigned long start_pfn, unsigned long end_pfn); | 19 | extern int amd_numa_init(unsigned long start_pfn, unsigned long end_pfn); |
@@ -38,18 +38,18 @@ struct amd_northbridge_info { | |||
38 | }; | 38 | }; |
39 | extern struct amd_northbridge_info amd_northbridges; | 39 | extern struct amd_northbridge_info amd_northbridges; |
40 | 40 | ||
41 | #define AMD_NB_GART 0x1 | 41 | #define AMD_NB_GART BIT(0) |
42 | #define AMD_NB_L3_INDEX_DISABLE 0x2 | 42 | #define AMD_NB_L3_INDEX_DISABLE BIT(1) |
43 | #define AMD_NB_L3_PARTITIONING 0x4 | 43 | #define AMD_NB_L3_PARTITIONING BIT(2) |
44 | 44 | ||
45 | #ifdef CONFIG_AMD_NB | 45 | #ifdef CONFIG_AMD_NB |
46 | 46 | ||
47 | static inline int amd_nb_num(void) | 47 | static inline u16 amd_nb_num(void) |
48 | { | 48 | { |
49 | return amd_northbridges.num; | 49 | return amd_northbridges.num; |
50 | } | 50 | } |
51 | 51 | ||
52 | static inline int amd_nb_has_feature(int feature) | 52 | static inline bool amd_nb_has_feature(unsigned feature) |
53 | { | 53 | { |
54 | return ((amd_northbridges.flags & feature) == feature); | 54 | return ((amd_northbridges.flags & feature) == feature); |
55 | } | 55 | } |
diff --git a/arch/x86/kernel/amd_nb.c b/arch/x86/kernel/amd_nb.c index ed3c2e5b714a..65634190ffd6 100644 --- a/arch/x86/kernel/amd_nb.c +++ b/arch/x86/kernel/amd_nb.c | |||
@@ -48,7 +48,7 @@ static struct pci_dev *next_northbridge(struct pci_dev *dev, | |||
48 | 48 | ||
49 | int amd_cache_northbridges(void) | 49 | int amd_cache_northbridges(void) |
50 | { | 50 | { |
51 | int i = 0; | 51 | u16 i = 0; |
52 | struct amd_northbridge *nb; | 52 | struct amd_northbridge *nb; |
53 | struct pci_dev *misc, *link; | 53 | struct pci_dev *misc, *link; |
54 | 54 | ||
@@ -103,9 +103,11 @@ int amd_cache_northbridges(void) | |||
103 | } | 103 | } |
104 | EXPORT_SYMBOL_GPL(amd_cache_northbridges); | 104 | EXPORT_SYMBOL_GPL(amd_cache_northbridges); |
105 | 105 | ||
106 | /* Ignores subdevice/subvendor but as far as I can figure out | 106 | /* |
107 | they're useless anyways */ | 107 | * Ignores subdevice/subvendor but as far as I can figure out |
108 | int __init early_is_amd_nb(u32 device) | 108 | * they're useless anyways |
109 | */ | ||
110 | bool __init early_is_amd_nb(u32 device) | ||
109 | { | 111 | { |
110 | const struct pci_device_id *id; | 112 | const struct pci_device_id *id; |
111 | u32 vendor = device & 0xffff; | 113 | u32 vendor = device & 0xffff; |
@@ -113,8 +115,8 @@ int __init early_is_amd_nb(u32 device) | |||
113 | device >>= 16; | 115 | device >>= 16; |
114 | for (id = amd_nb_misc_ids; id->vendor; id++) | 116 | for (id = amd_nb_misc_ids; id->vendor; id++) |
115 | if (vendor == id->vendor && device == id->device) | 117 | if (vendor == id->vendor && device == id->device) |
116 | return 1; | 118 | return true; |
117 | return 0; | 119 | return false; |
118 | } | 120 | } |
119 | 121 | ||
120 | int amd_get_subcaches(int cpu) | 122 | int amd_get_subcaches(int cpu) |
@@ -176,9 +178,9 @@ int amd_set_subcaches(int cpu, int mask) | |||
176 | return 0; | 178 | return 0; |
177 | } | 179 | } |
178 | 180 | ||
179 | int amd_cache_gart(void) | 181 | static int amd_cache_gart(void) |
180 | { | 182 | { |
181 | int i; | 183 | u16 i; |
182 | 184 | ||
183 | if (!amd_nb_has_feature(AMD_NB_GART)) | 185 | if (!amd_nb_has_feature(AMD_NB_GART)) |
184 | return 0; | 186 | return 0; |