[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH v4 07/53] xen/arch/x86/cpu/vpmu.c: let custom parameter parsing routines return errno
Modify the custom parameter parsing routines in: xen/arch/x86/cpu/vpmu.c to indicate whether the parameter value was parsed successfully. Cc: Jan Beulich <jbeulich@xxxxxxxx> Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx> Signed-off-by: Juergen Gross <jgross@xxxxxxxx> Acked-by: Wei Liu <wei.liu2@xxxxxxxxxx> Acked-by: Jan Beulich <jbeulich@xxxxxxxx> --- xen/arch/x86/cpu/vpmu.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/xen/arch/x86/cpu/vpmu.c b/xen/arch/x86/cpu/vpmu.c index 1c0ea10777..fd2fcacc26 100644 --- a/xen/arch/x86/cpu/vpmu.c +++ b/xen/arch/x86/cpu/vpmu.c @@ -53,7 +53,7 @@ CHECK_pmu_params; static unsigned int __read_mostly opt_vpmu_enabled; unsigned int __read_mostly vpmu_mode = XENPMU_MODE_OFF; unsigned int __read_mostly vpmu_features = 0; -static void parse_vpmu_params(char *s); +static int parse_vpmu_params(const char *s); custom_param("vpmu", parse_vpmu_params); static DEFINE_SPINLOCK(vpmu_lock); @@ -61,7 +61,7 @@ static unsigned vpmu_count; static DEFINE_PER_CPU(struct vcpu *, last_vcpu); -static int parse_vpmu_param(char *s, unsigned int len) +static int parse_vpmu_param(const char *s, unsigned int len) { if ( !*s || !len ) return 0; @@ -76,9 +76,9 @@ static int parse_vpmu_param(char *s, unsigned int len) return 0; } -static void __init parse_vpmu_params(char *s) +static int __init parse_vpmu_params(const char *s) { - char *sep, *p = s; + const char *sep, *p = s; switch ( parse_bool(s, NULL) ) { @@ -104,10 +104,11 @@ static void __init parse_vpmu_params(char *s) opt_vpmu_enabled = 1; break; } - return; + return 0; error: printk("VPMU: unknown flags: %s - vpmu disabled!\n", s); + return -EINVAL; } void vpmu_lvtpc_update(uint32_t val) -- 2.12.3 _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx https://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |