lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <559A82D6.5040007@hurleysoftware.com>
Date:	Mon, 06 Jul 2015 09:29:58 -0400
From:	Peter Hurley <peter@...leysoftware.com>
To:	Steven Rostedt <rostedt@...dmis.org>,
	Ingo Molnar <mingo@...nel.org>
CC:	LKML <linux-kernel@...r.kernel.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	"H. Peter Anvin" <hpa@...or.com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	David Cohen <david.a.cohen@...ux.intel.com>,
	Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
	Alan Cox <alan@...ux.intel.com>,
	"Stuart R. Anderson" <stuart.r.anderson@...el.com>,
	Joe Perches <joe@...ches.com>
Subject: Re: [RFC][PATCH] x86: Allow early_printk to use console style param
 like 115200n8

On 07/04/2015 09:20 AM, Steven Rostedt wrote:
> On Sat, 4 Jul 2015 13:03:59 +0200
> Ingo Molnar <mingo@...nel.org> wrote:
> 
> 
>>> +		/*
>>> +		 * 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;
>>
>>
> 
> This was actually one of those cases where I wanted to show that
> keeping the old function around is better than the alternative ;-)
> 
> If people say we need to phase out simple_strtoull(), then I wanted to
> show what kinds of hacks we will have if that happens.
> 
> I was hoping that someone would point out that simple_strtoull() is a
> better solution. :)

And made worse by the fact that checkpatch flags simple_strtoul* as
obsolete, so people keep submitting junk like above [1] in an effort to
escape the checkpatch warning.

Which I pointed out to Joe back in Feb. (https://lkml.org/lkml/2015/2/25/217)

Regards,
Peter Hurley

[1] or this recent submission

On 05/26/2015 01:12 PM, Peter Hurley wrote:
> On 05/22/2015 12:06 PM, Bin Gao wrote:
>
>> +{
>> +	char str[4]; /* max 3 chars, plus a NULL terminator */
>> +	char *p = options;
>> +	int i = 0;
>> +
>> +	while (*p) {
>> +		if (i >= 4)
>> +			return -EINVAL;
>> +
>> +		if (*p == delimiter) {
>> +			str[i++] = 0;
>> +			if (endp)
>> +				*endp = p + 1;
>> +			return kstrtou8(str, 10, val); /* decimal, no hex */
>> +		}
>> +
>> +		str[i++] = *p++;
>> +	}
> 
> Is all this to avoid using simple_strtoul()?
> If yes, I'd rather you use simple_strtoul() like the rest of the console
> code and ignore the (misguided) advice that simple_strtoul() is obsolete.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ