From: Don Slutz <dslutz@verizon.com>
To: xen-devel@lists.xen.org
Cc: Keir Fraser <keir@xen.org>,
Ian Campbell <ian.campbell@citrix.com>,
Andrew Cooper <andrew.cooper3@citrix.com>,
Ian Jackson <ian.jackson@eu.citrix.com>,
Don Slutz <dslutz@verizon.com>, Tim Deegan <tim@xen.org>,
Jan Beulich <jbeulich@suse.com>
Subject: [PATCH v2 2/2] xen/console: Better handing of console_timestamps as a boolean_param
Date: Tue, 29 Jul 2014 15:57:49 -0400 [thread overview]
Message-ID: <1406663869-31522-3-git-send-email-dslutz@verizon.com> (raw)
In-Reply-To: <1406663869-31522-1-git-send-email-dslutz@verizon.com>
In order to handle all the old ways, change to use parse_bool().
Signed-off-by: Don Slutz <dslutz@verizon.com>
---
v2:
Drop stacked inversions part of patch.
xen/drivers/char/console.c | 26 ++++++++++++++++++--------
1 file changed, 18 insertions(+), 8 deletions(-)
diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
index 2f6c090..4f473e3 100644
--- 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;
+ default:
+ 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") )
+ opt_con_timestamp_mode = TSM_NONE;
+ }
}
static void printk_start_of_line(const char *prefix)
--
1.8.4
next prev parent reply other threads:[~2014-07-29 19:57 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-29 19:57 [PATCH v2 0/2] parse_bool fixes Don Slutz
2014-07-29 19:57 ` [PATCH v2 1/2] cmdline_parse: Convert no- prefix into =no for OPT_CUSTOM Don Slutz
2014-07-30 7:58 ` Jan Beulich
2014-07-31 0:59 ` Don Slutz
2014-08-01 6:57 ` Jan Beulich
2014-08-01 12:36 ` Don Slutz
2014-08-04 10:58 ` Ian Campbell
2014-08-04 11:39 ` Jan Beulich
2014-07-29 19:57 ` Don Slutz [this message]
2014-07-30 8:01 ` [PATCH v2 2/2] xen/console: Better handing of console_timestamps as a boolean_param Jan Beulich
2014-07-30 8:06 ` Jan Beulich
2014-07-31 0:36 ` Don Slutz
2014-08-04 11:00 ` Ian Campbell
2014-07-29 20:10 ` [PATCH v2 0/2] parse_bool fixes Andrew Cooper
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1406663869-31522-3-git-send-email-dslutz@verizon.com \
--to=dslutz@verizon.com \
--cc=andrew.cooper3@citrix.com \
--cc=ian.campbell@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=jbeulich@suse.com \
--cc=keir@xen.org \
--cc=tim@xen.org \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).