[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH v4 30/53] xen/drivers/acpi/tables.c: let custom parameter parsing routines return errno



Modify the custom parameter parsing routines in:

xen/drivers/acpi/tables.c

to indicate whether the parameter value was parsed successfully.

Cc: Jan Beulich <jbeulich@xxxxxxxx>
Signed-off-by: Juergen Gross <jgross@xxxxxxxx>
Acked-by: Wei Liu <wei.liu2@xxxxxxxxxx>
Acked-by: Jan Beulich <jbeulich@xxxxxxxx>
---
 xen/drivers/acpi/tables.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/xen/drivers/acpi/tables.c b/xen/drivers/acpi/tables.c
index dd2031f36a..b890b73901 100644
--- a/xen/drivers/acpi/tables.c
+++ b/xen/drivers/acpi/tables.c
@@ -456,14 +456,15 @@ int __init acpi_table_init(void)
        return 0;
 }
 
-static int __init acpi_parse_apic_instance(char *str)
+static int __init acpi_parse_apic_instance(const char *str)
 {
+       const char *q;
 
-       acpi_apic_instance = simple_strtoul(str, NULL, 0);
+       acpi_apic_instance = simple_strtoul(str, &q, 0);
 
        printk(KERN_NOTICE PREFIX "Shall use APIC/MADT table %d\n",
               acpi_apic_instance);
 
-       return 0;
+       return *q ? -EINVAL : 0;
 }
 custom_param("acpi_apic_instance", acpi_parse_apic_instance);
-- 
2.12.3


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.