@@ -14,15 +14,15 @@
#include <linux/types.h>
#include <linux/cpumask.h>
-static inline int paravirt_enabled(void)
+static inline bool paravirt_enabled(void)
{
return pv_info.paravirt_enabled;
}
-static inline int paravirt_has_feature(unsigned int feature)
+static inline bool paravirt_has_feature(unsigned int feature)
{
WARN_ON_ONCE(!pv_info.paravirt_enabled);
- return (pv_info.features & feature);
+ return !!(pv_info.features & feature);
}
static inline void load_sp0(struct tss_struct *tss,
@@ -69,7 +69,7 @@ struct pv_info {
u16 extra_user_64bit_cs; /* __USER_CS if none */
#endif
- int paravirt_enabled;
+ bool paravirt_enabled;
unsigned int features; /* valid only if paravirt_enabled is set */
const char *name;
};
@@ -470,8 +470,8 @@ static inline unsigned long current_top_of_stack(void)
#include <asm/paravirt.h>
#else
#define __cpuid native_cpuid
-#define paravirt_enabled() 0
-#define paravirt_has(x) 0
+#define paravirt_enabled() false
+#define paravirt_has(x) false
static inline void load_sp0(struct tss_struct *tss,
struct thread_struct *thread)
@@ -290,7 +290,7 @@ static void __init paravirt_ops_setup(void)
* features, and paravirt_enabled is about features that are
* missing.
*/
- pv_info.paravirt_enabled = 0;
+ pv_info.paravirt_enabled = false;
if (kvm_para_has_feature(KVM_FEATURE_NOP_IO_DELAY))
pv_cpu_ops.io_delay = kvm_io_delay;
@@ -294,7 +294,7 @@ enum paravirt_lazy_mode paravirt_get_lazy_mode(void)
struct pv_info pv_info = {
.name = "bare hardware",
- .paravirt_enabled = 0,
+ .paravirt_enabled = false,
.kernel_rpl = 0,
.shared_kernel_pmd = 1, /* Only used when CONFIG_X86_PAE is set */
@@ -1409,7 +1409,7 @@ __init void lguest_init(void)
/* We're under lguest. */
pv_info.name = "lguest";
/* Paravirt is enabled. */
- pv_info.paravirt_enabled = 1;
+ pv_info.paravirt_enabled = true;
/* We're running at privilege level 1, not 0 as normal. */
pv_info.kernel_rpl = 1;
/* Everyone except Xen runs with this set. */
@@ -1186,7 +1186,7 @@ static unsigned xen_patch(u8 type, u16 clobbers, void *insnbuf,
}
static const struct pv_info xen_info __initconst = {
- .paravirt_enabled = 1,
+ .paravirt_enabled = true,
.shared_kernel_pmd = 0,
#ifdef CONFIG_X86_64
This avoids any possible misuse. Signed-off-by: Luis R. Rodriguez <mcgrof@kernel.org> --- arch/x86/include/asm/paravirt.h | 6 +++--- arch/x86/include/asm/paravirt_types.h | 2 +- arch/x86/include/asm/processor.h | 4 ++-- arch/x86/kernel/kvm.c | 2 +- arch/x86/kernel/paravirt.c | 2 +- arch/x86/lguest/boot.c | 2 +- arch/x86/xen/enlighten.c | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-)