x86/dom0: switch parse_dom0_param to use parse_boolean
authorRoger Pau Monne <roger.pau@citrix.com>
Tue, 9 Oct 2018 09:42:32 +0000 (11:42 +0200)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 15 Oct 2018 13:34:53 +0000 (14:34 +0100)
No functional change expected.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/dom0_build.c

index 86eb7db1daf9b237e1b7ab3ed1ee0bdaf15e90ae..dcd7afb05860e21be9b5de8d5e8c199eacef834e 100644 (file)
@@ -225,16 +225,17 @@ static int __init parse_dom0_param(const char *s)
     int rc = 0;
 
     do {
+        int val;
 
         ss = strchr(s, ',');
         if ( !ss )
             ss = strchr(s, '\0');
 
-        if ( !strncmp(s, "pvh", ss - s) )
-            dom0_pvh = true;
+        if ( (val = parse_boolean("pvh", s, ss)) >= 0 )
+            dom0_pvh = val;
 #ifdef CONFIG_SHADOW_PAGING
-        else if ( !strncmp(s, "shadow", ss - s) )
-            opt_dom0_shadow = true;
+        else if ( (val = parse_boolean("shadow", s, ss)) >= 0 )
+            opt_dom0_shadow = val;
 #endif
         else
             rc = -EINVAL;