Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751816AbbGEIco (ORCPT ); Sun, 5 Jul 2015 04:32:44 -0400 Received: from cdptpa-outbound-snat.email.rr.com ([107.14.166.230]:31496 "EHLO cdptpa-queue03.email.rr.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751131AbbGEIcb (ORCPT ); Sun, 5 Jul 2015 04:32:31 -0400 Date: Sat, 4 Jul 2015 09:16:04 -0400 From: Steven Rostedt To: Ingo Molnar Cc: LKML , Thomas Gleixner , "H. Peter Anvin" , Greg Kroah-Hartman , David Cohen , Andy Shevchenko , Alan Cox , "Stuart R. Anderson" Subject: Re: [RFC][PATCH] x86: Allow early_printk to use console style param like 115200n8 Message-ID: <20150704091604.10265453@grimm.local.home> In-Reply-To: <20150704110359.GA18107@gmail.com> References: <20150703181643.4fd4053d@grimm.local.home> <20150704110359.GA18107@gmail.com> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.25; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-RR-Connecting-IP: 107.14.168.118:25 X-Cloudmark-Score: 0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1249 Lines: 41 On Sat, 4 Jul 2015 13:03:59 +0200 Ingo Molnar wrote: > So why not revert to the known-working simple_strtoul()? I don't see this as an > improvement: > > > + /* > > + * In case the input is like console with text after the baud > > + * rate. e.g. 115200n8. kstrtoul() will error on such input. > > + */ > > + for (p = s; *p && isdigit(*p); p++) > > + ; > > + *p = 0; > > + > > if (kstrtoul(s, 0, &baud) < 0 || baud == 0) > > baud = DEFAULT_BAUD; > > > Over the old: > > baud = simple_strtoul(s, &e, 0); > That was what I actually did first, but then saw this: * Returns 0 on success, -ERANGE on overflow and -EINVAL on parsing error. * Used as a replacement for the obsolete simple_strtoull. Return code must * be checked. in lib/kstrtox.c and thought that it seems that we are trying to phase out that function. Personally, I prefer keeping it for instances like this. So by all means, put back the simple_strtoul(); I would like that too. -- Steve -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/