public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Heiko Schocher <hs@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v5 2/3] mtd, nand: move common functions from cmd_nand.c to common place
Date: Fri, 24 Apr 2015 06:59:05 +0200	[thread overview]
Message-ID: <5539CD99.8000908@denx.de> (raw)
In-Reply-To: <1429811305.16357.17.camel@freescale.com>

Hello Scott,

Am 23.04.2015 19:48, schrieb Scott Wood:
> 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.

Hmm.. tried this, but I get:

   CC      common/cmd_test.o
In file included from /home/hs/abb/imx6/u-boot/include/common.h:760:0,
                  from /home/hs/abb/imx6/u-boot/common/cmd_test.c:17:
/home/hs/abb/imx6/u-boot/include/vsprintf.h:176:1: error: unknown type name 'bool'
/home/hs/abb/imx6/u-boot/include/vsprintf.h:177:1: error: unknown type name 'bool'
/home/hs/abb/imx6/u-boot/scripts/Makefile.build:276: recipe for target 'common/cmd_test.o' failed
make[2]: *** [common/cmd_test.o] Error 1
/home/hs/abb/imx6/u-boot/Makefile:1156: recipe for target 'common' failed
make[1]: *** [common] Error 2

reason is in common/cmd_test.c:

/*
  * Define _STDBOOL_H here to avoid macro expansion of true and false.
  * If the future code requires macro true or false, remove this define
  * and undef true and false before U_BOOT_CMD. This define and comment
  * shall be removed if change to U_BOOT_CMD is made to take string
  * instead of stringifying it.
  */
#define _STDBOOL_H

#include <common.h>

Hmm... I tend to say, this is another patch changing the returntype
from int to bool ...

bye,
Heiko
-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

  reply	other threads:[~2015-04-24  4:59 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-20  5:47 [U-Boot] [PATCH v5 0/3] spi, sf: add mtdparts feature to spi and sf commands Heiko Schocher
2015-04-20  5:47 ` [U-Boot] [PATCH v5 1/3] mtd, spi: add MTD layer driver Heiko Schocher
2015-04-22 10:52   ` Jagan Teki
2015-04-23  5:27     ` Heiko Schocher
2015-04-20  5:47 ` [U-Boot] [PATCH v5 2/3] mtd, nand: move common functions from cmd_nand.c to common place Heiko Schocher
2015-04-22 10:53   ` Jagan Teki
2015-04-22 22:47   ` Scott Wood
2015-04-23  5:57     ` Heiko Schocher
2015-04-23  6:55       ` Scott Wood
2015-04-23 11:12         ` Heiko Schocher
2015-04-23 17:48           ` Scott Wood
2015-04-24  4:59             ` Heiko Schocher [this message]
2015-04-24  5:25               ` Scott Wood
2015-04-20  5:47 ` [U-Boot] [PATCH v5 3/3] spi, sf: use offset and size in sf cmd from mtdpartition Heiko Schocher
2015-04-22 10:58   ` Jagan Teki
2015-04-23  5:38     ` Heiko Schocher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5539CD99.8000908@denx.de \
    --to=hs@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox