From: Scott Wood Date: Thu, 23 Apr 2015 12:48:25 -0500 Subject: [U-Boot] [PATCH v5 2/3] mtd, nand: move common functions from cmd_nand.c to common place In-Reply-To: <5538D38A.4090204@denx.de> References: <1429508853-10139-1-git-send-email-hs@denx.de> <1429508853-10139-3-git-send-email-hs@denx.de> <1429742874.4352.138.camel@freescale.com> <553889C2.6050904@denx.de> <1429772150.16357.14.camel@freescale.com> <5538D38A.4090204@denx.de> Message-ID: <1429811305.16357.17.camel@freescale.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Thu, 2015-04-23 at 13:12 +0200, Heiko Schocher wrote: > Hello Scott, > > Am 23.04.2015 08:55, schrieb Scott Wood: > > On Thu, 2015-04-23 at 07:57 +0200, Heiko Schocher wrote: > >> Hello Scott, > >> > >> Am 23.04.2015 00:47, schrieb Scott Wood: > >>> On Mon, 2015-04-20 at 07:47 +0200, Heiko Schocher wrote: > >>>> +int str2off(const char *p, loff_t *num); > >>>> +int str2long(const char *p, ulong *num); > >>> > >>> These should be moved somewhere more generic, especially if they're no > >>> longer file-local. > >> > >> Hmm... the code is currently in "drivers/mtd/mtd_uboot.c" ... maybe > >> we add a "mtd_" prefix to them? I think these functions are mtd specific ... > > > > What is mtd-specific about them? > > Hmm... I thought: > > return *p != '\0' && *endptr == '\0'; > > is more or less mtd specific ... but you are right, it is not really > mtd specific ... so I move them to "./lib/vsprintf.c" ... Ok? OK. Maybe change the return to bool while you're at it, to make it clear that it isn't return-zero-on-success. -Scott