From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753239AbbGJGq5 (ORCPT ); Fri, 10 Jul 2015 02:46:57 -0400 Received: from mail-wg0-f45.google.com ([74.125.82.45]:34191 "EHLO mail-wg0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751709AbbGJGqs (ORCPT ); Fri, 10 Jul 2015 02:46:48 -0400 Date: Fri, 10 Jul 2015 09:46:45 +0300 From: Alexey Dobriyan To: Andrew Morton Cc: linux-kernel@vger.kernel.org, linux@rasmusvillemoes.dk, Joe Perches Subject: Re: [PATCH 02/12] Add parse_integer() (replacement for simple_strto*()) Message-ID: <20150710064645.GA2352@p183.telecom.by> References: <20150508182911.GA9044@p183.telecom.by> <20150508183029.GB9044@p183.telecom.by> <20150709122841.ed218895c5cda9186c91ae52@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150709122841.ed218895c5cda9186c91ae52@linux-foundation.org> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 09, 2015 at 12:28:41PM -0700, Andrew Morton wrote: > On Fri, 8 May 2015 21:30:29 +0300 Alexey Dobriyan wrote: > > > Enter parse_integer(). > > > > int parse_integer(const char *s, unsigned int base, T *val); > > OK, I grabbed these. Thanks! Just to note, first patch (accept "-0") is independent and can be sent at any time. > Let's see how it goes. Were these patches still up to date? Yes, kstrto*(), scanf() didn't change since when this was sent. > Presumably we'd benefit from a checkpatch rule to alert people to the > new regime. Can you please suggest what such a rule should do? It should say to switch from simple_strto*() to one of the 4 officially sanctioned integer conversion routines: parse_integer(), kstrto*(), kstrto*_from_user(), sscanf(). I'll send a patch. > The macros in lib/test-parse-integer.c hurt my brain. Well, yes, but the only interesting thing there are test tables. Alexey