xen/common/sched_credit2.c: let custom parameter parsing routines return errno
authorJuergen Gross <jgross@suse.com>
Wed, 23 Aug 2017 17:38:00 +0000 (19:38 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 25 Aug 2017 14:18:34 +0000 (16:18 +0200)
Modify the custom parameter parsing routines in:

xen/common/sched_credit2.c

to indicate whether the parameter value was parsed successfully.

Signed-off-by: Juergen Gross <jgross@suse.com>
Acked-by: Dario Faggioli <dario.faggioli@citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
xen/common/sched_credit2.c

index 29c002a63eb079707dc4ae8a792fbb1999c71c72..9b1db1351f300e89f634d599345ef8c9acf28092 100644 (file)
@@ -339,7 +339,7 @@ static const char *const opt_runqueue_str[] = {
 };
 static int __read_mostly opt_runqueue = OPT_RUNQUEUE_SOCKET;
 
-static void parse_credit2_runqueue(const char *s)
+static int parse_credit2_runqueue(const char *s)
 {
     unsigned int i;
 
@@ -348,11 +348,13 @@ static void parse_credit2_runqueue(const char *s)
         if ( !strcmp(s, opt_runqueue_str[i]) )
         {
             opt_runqueue = i;
-            return;
+            return 0;
         }
     }
 
     printk("WARNING, unrecognized value of credit2_runqueue option!\n");
+
+    return -EINVAL;
 }
 custom_param("credit2_runqueue", parse_credit2_runqueue);