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

[Xen-devel] [PATCH v2 16/52] xen/arch/x86/numa.c: let custom parameter parsing routines return errno



Modify the custom parameter parsing routines in:

xen/arch/x86/numa.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>
---
 xen/arch/x86/numa.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/numa.c b/xen/arch/x86/numa.c
index d45196fafc..9454f5f9f4 100644
--- a/xen/arch/x86/numa.c
+++ b/xen/arch/x86/numa.c
@@ -303,10 +303,10 @@ static __init int numa_setup(char *opt)
 { 
     if ( !strncmp(opt,"off",3) )
         numa_off = true;
-    if ( !strncmp(opt,"on",2) )
+    else if ( !strncmp(opt,"on",2) )
         numa_off = false;
 #ifdef CONFIG_NUMA_EMU
-    if ( !strncmp(opt, "fake=", 5) )
+    else if ( !strncmp(opt, "fake=", 5) )
     {
         numa_off = false;
         numa_fake = simple_strtoul(opt+5,NULL,0);
@@ -315,14 +315,16 @@ static __init int numa_setup(char *opt)
     }
 #endif
 #ifdef CONFIG_ACPI_NUMA
-    if ( !strncmp(opt,"noacpi",6) )
+    else if ( !strncmp(opt,"noacpi",6) )
     {
         numa_off = false;
         acpi_numa = -1;
     }
 #endif
+    else
+        return -EINVAL;
 
-    return 1;
+    return 0;
 } 
 
 /*
-- 
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®.