From mboxrd@z Thu Jan 1 00:00:00 1970 From: Don Slutz Subject: Re: [PATCH v2 2/2] xen/console: Better handing of console_timestamps as a boolean_param Date: Wed, 30 Jul 2014 20:36:32 -0400 Message-ID: <53D98F90.1030305@terremark.com> References: <1406663869-31522-1-git-send-email-dslutz@verizon.com> <1406663869-31522-3-git-send-email-dslutz@verizon.com> <53D8C2770200007800027892@mail.emea.novell.com> <53D8C3A502000078000278A7@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <53D8C3A502000078000278A7@mail.emea.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich , Don Slutz Cc: Keir Fraser , Ian Campbell , Andrew Cooper , Tim Deegan , xen-devel@lists.xen.org, Ian Jackson List-Id: xen-devel@lists.xenproject.org On 07/30/14 04:06, Jan Beulich wrote: >>>> On 30.07.14 at 10:01, wrote: >>>>> On 29.07.14 at 21:57, wrote: >>> --- a/xen/drivers/char/console.c >>> +++ b/xen/drivers/char/console.c >> 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 > Reviewed-by: Andrew Cooper > > Restructure code to limit churn. > > Signed-off-by: Jan Beulich This is fine with me. -Don Slutz > --- 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; > > >