x86/mtrr: convert use_intel_if u32 to bool

This field is always only 1 currently but may allow 0 in the future so
convert it to a bool to provide proper range checking by the compiler.

Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
This commit is contained in:
Doug Goldstein authored and Jan Beulich committed 2017-01-19 10:36:14 +01:00
1 parent a80f58f2e4
commit 850fd17ed2
2 files changed
+3 -3

No files matched your search

+1 -1
View File
@@ -560,7 +560,7 @@ static int generic_have_wrcomb(void)
/* generic structure...
*/
const struct mtrr_ops generic_mtrr_ops = {
.use_intel_if = 1,
.use_intel_if = true,
.set_all = generic_set_all,
.get = generic_get_mtrr,
.get_free_region = generic_get_free_region,
+2 -2
View File
@@ -9,7 +9,7 @@
struct mtrr_ops {
u32 vendor;
u32 use_intel_if;
bool use_intel_if;
// void (*init)(void);
void (*set)(unsigned int reg, unsigned long base,
unsigned long size, mtrr_type type);
@@ -39,7 +39,7 @@ extern u64 size_or_mask, size_and_mask;
extern const struct mtrr_ops *mtrr_if;
#define is_cpu(vnd) (mtrr_if && mtrr_if->vendor == X86_VENDOR_##vnd)
#define use_intel() (mtrr_if && mtrr_if->use_intel_if == 1)
#define use_intel() (mtrr_if && mtrr_if->use_intel_if)
extern unsigned int num_var_ranges;
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.