[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v2 2/2] xen/console: Better handing of console_timestamps as a boolean_param
>>> On 30.07.14 at 10:01, <JBeulich@xxxxxxxx> wrote: >>>> On 29.07.14 at 21:57, <dslutz@xxxxxxxxxxx> wrote: >> --- a/xen/drivers/char/console.c >> +++ b/xen/drivers/char/console.c >> @@ -559,15 +559,25 @@ static int printk_prefix_check(char *p, char **pp) >> >> static void __init parse_console_timestamps(char *s) >> { >> - if ( *s == '\0' || /* Compat for old booleanparam() */ >> - !strcmp(s, "date") ) >> - opt_con_timestamp_mode = TSM_DATE; >> - else if ( !strcmp(s, "datems") ) >> - opt_con_timestamp_mode = TSM_DATE_MS; >> - else if ( !strcmp(s, "boot") ) >> - opt_con_timestamp_mode = TSM_BOOT; >> - else if ( !strcmp(s, "none") ) >> + switch ( parse_bool(s) ) >> + { >> + case 0: >> opt_con_timestamp_mode = TSM_NONE; >> + break; >> + case 1: >> + opt_con_timestamp_mode = TSM_DATE; >> + break; > > The patch could have been quite a bit smaller if you used "return" > instead of "break" in the two above cases. I.e. console: better handing of console_timestamps as a boolean_param In order to handle all the old ways, change to use parse_bool(). Signed-off-by: Don Slutz <dslutz@xxxxxxxxxxx> Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx> Restructure code to limit churn. Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx> --- a/xen/drivers/char/console.c +++ b/xen/drivers/char/console.c @@ -559,6 +559,15 @@ static int printk_prefix_check(char *p, static void __init parse_console_timestamps(char *s) { + switch ( parse_bool(s) ) + { + case 0: + opt_con_timestamp_mode = TSM_NONE; + return; + case 1: + opt_con_timestamp_mode = TSM_DATE; + return; + } if ( *s == '\0' || /* Compat for old booleanparam() */ !strcmp(s, "date") ) opt_con_timestamp_mode = TSM_DATE; Attachment:
console_timestamps-boolean.patch _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |