From: Wei Liu <wei.liu2@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
Wei Liu <wei.liu2@citrix.com>, Jan Beulich <JBeulich@suse.com>
Subject: [PATCH 7/8] x86/nmi.c: use plain bool
Date: Wed, 28 Jun 2017 15:18:26 +0100 [thread overview]
Message-ID: <20170628141827.19046-8-wei.liu2@citrix.com> (raw)
In-Reply-To: <20170628141827.19046-1-wei.liu2@citrix.com>
While at it, change check_nmi_watchdog to return void because its
return value is not used anyway.
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
xen/arch/x86/nmi.c | 34 +++++++++++++++++-----------------
xen/include/asm-x86/apic.h | 4 ++--
2 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/xen/arch/x86/nmi.c b/xen/arch/x86/nmi.c
index ced61fd17e..8914581f66 100644
--- a/xen/arch/x86/nmi.c
+++ b/xen/arch/x86/nmi.c
@@ -41,31 +41,31 @@ static DEFINE_PER_CPU(struct timer, nmi_timer);
static DEFINE_PER_CPU(unsigned int, nmi_timer_ticks);
/* opt_watchdog: If true, run a watchdog NMI on each processor. */
-bool_t __initdata opt_watchdog = 0;
+bool __initdata opt_watchdog;
/* watchdog_force: If true, process unknown NMIs when running the watchdog. */
-bool_t watchdog_force = 0;
+bool watchdog_force;
static void __init parse_watchdog(char *s)
{
if ( !*s )
{
- opt_watchdog = 1;
+ opt_watchdog = true;
return;
}
switch ( parse_bool(s) )
{
case 0:
- opt_watchdog = 0;
+ opt_watchdog = false;
return;
case 1:
- opt_watchdog = 1;
+ opt_watchdog = true;
return;
}
if ( !strcmp(s, "force") )
- watchdog_force = opt_watchdog = 1;
+ watchdog_force = opt_watchdog = true;
}
custom_param("watchdog", parse_watchdog);
@@ -152,14 +152,14 @@ static void __init wait_for_nmis(void *p)
} while( e - s < ticks );
}
-int __init check_nmi_watchdog (void)
+void __init check_nmi_watchdog(void)
{
static unsigned int __initdata prev_nmi_count[NR_CPUS];
int cpu;
- bool_t ok = 1;
+ bool ok = true;
if ( nmi_watchdog == NMI_NONE )
- return 0;
+ return;
printk("Testing NMI watchdog on all CPUs:");
@@ -178,7 +178,7 @@ int __init check_nmi_watchdog (void)
if ( nmi_count(cpu) - prev_nmi_count[cpu] < 2 )
{
printk(" %d", cpu);
- ok = 0;
+ ok = false;
}
}
@@ -196,7 +196,7 @@ int __init check_nmi_watchdog (void)
if ( nmi_watchdog == NMI_LOCAL_APIC )
nmi_hz = max(1ul, cpu_khz >> 20);
- return 0;
+ return;
}
static void nmi_timer_fn(void *unused)
@@ -448,7 +448,7 @@ void watchdog_enable(void)
atomic_dec(&watchdog_disable_count);
}
-bool_t watchdog_enabled(void)
+bool watchdog_enabled(void)
{
return !atomic_read(&watchdog_disable_count);
}
@@ -470,9 +470,9 @@ int __init watchdog_setup(void)
}
/* Returns false if this was not a watchdog NMI, true otherwise */
-bool_t nmi_watchdog_tick(const struct cpu_user_regs *regs)
+bool nmi_watchdog_tick(const struct cpu_user_regs *regs)
{
- bool_t watchdog_tick = 1;
+ bool watchdog_tick = true;
unsigned int sum = this_cpu(nmi_timer_ticks);
if ( (this_cpu(last_irq_sums) == sum) && watchdog_enabled() )
@@ -505,7 +505,7 @@ bool_t nmi_watchdog_tick(const struct cpu_user_regs *regs)
{
rdmsrl(MSR_P4_IQ_CCCR0, msr_content);
if ( !(msr_content & P4_CCCR_OVF) )
- watchdog_tick = 0;
+ watchdog_tick = false;
/*
* P4 quirks:
@@ -521,7 +521,7 @@ bool_t nmi_watchdog_tick(const struct cpu_user_regs *regs)
{
rdmsrl(MSR_P6_PERFCTR(0), msr_content);
if ( msr_content & (1ULL << P6_EVENT_WIDTH) )
- watchdog_tick = 0;
+ watchdog_tick = false;
/*
* Only P6 based Pentium M need to re-unmask the apic vector but
@@ -533,7 +533,7 @@ bool_t nmi_watchdog_tick(const struct cpu_user_regs *regs)
{
rdmsrl(MSR_K7_PERFCTR0, msr_content);
if ( msr_content & (1ULL << K7_EVENT_WIDTH) )
- watchdog_tick = 0;
+ watchdog_tick = false;
}
write_watchdog_counter(NULL);
}
diff --git a/xen/include/asm-x86/apic.h b/xen/include/asm-x86/apic.h
index 342db73a9d..ea675b7f0a 100644
--- a/xen/include/asm-x86/apic.h
+++ b/xen/include/asm-x86/apic.h
@@ -186,7 +186,7 @@ extern void release_lapic_nmi(void);
extern void self_nmi(void);
extern void disable_timer_nmi_watchdog(void);
extern void enable_timer_nmi_watchdog(void);
-extern bool_t nmi_watchdog_tick (const struct cpu_user_regs *regs);
+extern bool nmi_watchdog_tick(const struct cpu_user_regs *regs);
extern int APIC_init_uniprocessor (void);
extern void disable_APIC_timer(void);
extern void enable_APIC_timer(void);
@@ -196,7 +196,7 @@ extern void record_boot_APIC_mode(void);
extern enum apic_mode current_local_apic_mode(void);
extern void check_for_unexpected_msi(unsigned int vector);
-extern int check_nmi_watchdog (void);
+extern void check_nmi_watchdog(void);
extern unsigned int nmi_watchdog;
#define NMI_NONE 0
--
2.11.0
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2017-06-28 14:18 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-28 14:18 [PATCH 0/8] x86: bool_t to bool cleanup Wei Liu
2017-06-28 14:18 ` [PATCH 1/8] x86/irq.c: use plain bool Wei Liu
2017-06-28 14:21 ` Andrew Cooper
2017-06-29 6:53 ` Jan Beulich
2017-06-29 10:35 ` Wei Liu
2017-06-28 14:18 ` [PATCH 2/8] x86/platform_hypercall.c: " Wei Liu
2017-06-28 14:21 ` Andrew Cooper
2017-06-28 14:18 ` [PATCH 3/8] x86/domain.c: " Wei Liu
2017-06-28 14:22 ` Andrew Cooper
2017-06-29 6:55 ` Jan Beulich
2017-06-28 14:18 ` [PATCH 4/8] x86/dom0_build.c: " Wei Liu
2017-06-28 14:18 ` [PATCH 5/8] x86/crash.c: " Wei Liu
2017-06-28 14:18 ` [PATCH 6/8] x86/time.c: " Wei Liu
2017-06-29 6:59 ` Jan Beulich
2017-06-28 14:18 ` Wei Liu [this message]
2017-06-28 14:18 ` [PATCH 8/8] x86/setup.c: " Wei Liu
2017-06-28 14:26 ` Andrew Cooper
2017-06-28 14:57 ` Wei Liu
2017-06-28 16:21 ` Andrew Cooper
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170628141827.19046-8-wei.liu2@citrix.com \
--to=wei.liu2@citrix.com \
--cc=JBeulich@suse.com \
--cc=andrew.cooper3@citrix.com \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).