@@ -62,7 +62,7 @@ LIST_HEAD_READ_MOSTLY(cpufreq_governor_list);
/* set xen as default cpufreq */
enum cpufreq_controller cpufreq_controller = FREQCTL_xen;
-static void __init setup_cpufreq_option(char *str)
+static int __init setup_cpufreq_option(char *str)
{
char *arg = strpbrk(str, ",:");
int choice;
@@ -76,14 +76,14 @@ static void __init setup_cpufreq_option(char *str)
xen_processor_pmbits &= ~XEN_PROCESSOR_PM_PX;
cpufreq_controller = FREQCTL_dom0_kernel;
opt_dom0_vcpus_pin = 1;
- return;
+ return 0;
}
if ( choice == 0 || !strcmp(str, "none") )
{
xen_processor_pmbits &= ~XEN_PROCESSOR_PM_PX;
cpufreq_controller = FREQCTL_none;
- return;
+ return 0;
}
if ( choice > 0 || !strcmp(str, "xen") )
@@ -91,8 +91,10 @@ static void __init setup_cpufreq_option(char *str)
xen_processor_pmbits |= XEN_PROCESSOR_PM_PX;
cpufreq_controller = FREQCTL_xen;
if ( arg && *arg )
- cpufreq_cmdline_parse(arg);
+ return cpufreq_cmdline_parse(arg);
}
+
+ return (choice < 0) ? -EINVAL : 0;
}
custom_param("cpufreq", setup_cpufreq_option);
@@ -571,7 +573,7 @@ static int __init cpufreq_handle_common_option(const char *name, const char *val
return 0;
}
-void __init cpufreq_cmdline_parse(char *str)
+int __init cpufreq_cmdline_parse(char *str)
{
static struct cpufreq_governor *__initdata cpufreq_governors[] =
{
@@ -582,6 +584,7 @@ void __init cpufreq_cmdline_parse(char *str)
&cpufreq_gov_powersave
};
unsigned int gov_index = 0;
+ int rc = 0;
do {
char *val, *end = strchr(str, ',');
@@ -611,11 +614,16 @@ void __init cpufreq_cmdline_parse(char *str)
if (str && !cpufreq_handle_common_option(str, val) &&
(!cpufreq_governors[gov_index]->handle_option ||
!cpufreq_governors[gov_index]->handle_option(str, val)))
+ {
printk(XENLOG_WARNING "cpufreq/%s: option '%s' not recognized\n",
cpufreq_governors[gov_index]->name, str);
+ rc = -EINVAL;
+ }
str = end;
} while (str);
+
+ return rc;
}
static int cpu_callback(
@@ -79,7 +79,7 @@ DECLARE_PER_CPU(struct cpufreq_policy *, cpufreq_cpu_policy);
extern int __cpufreq_set_policy(struct cpufreq_policy *data,
struct cpufreq_policy *policy);
-void cpufreq_cmdline_parse(char *);
+int cpufreq_cmdline_parse(char *);
#define CPUFREQ_SHARED_TYPE_NONE (0) /* None */
#define CPUFREQ_SHARED_TYPE_HW (1) /* HW does needed coordination */
Modify the custom parameter parsing routines in: xen/drivers/cpufreq/cpufreq.c to indicate whether the parameter value was parsed successfully. Cc: Jan Beulich <jbeulich@suse.com> Signed-off-by: Juergen Gross <jgross@suse.com> --- xen/drivers/cpufreq/cpufreq.c | 18 +++++++++++++----- xen/include/acpi/cpufreq/cpufreq.h | 2 +- 2 files changed, 14 insertions(+), 6 deletions(-)