From: Thomas Chou <thomas@wytron.com.tw>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] mtd: do not include cfi_flash.h if no flash
Date: Sun, 25 Oct 2015 21:29:06 +0800 [thread overview]
Message-ID: <562CD922.1050503@wytron.com.tw> (raw)
In-Reply-To: <201510250500.35752.marex@denx.de>
Hi Marek,
On 10/25/2015 12:00 PM, Marek Vasut wrote:
> On Sunday, October 25, 2015 at 04:02:58 AM, Thomas Chou wrote:
>> Do not include cfi_flash.h if CONFIG_SYS_NO_FLASH. Because
>> the flash_info is undefined in flash.h if CONFIG_SYS_NO_FLASH.
>>
>> Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
>> ---
>> include/mtd/cfi_flash.h | 4 ++++
>> 1 file changed, 4 insertions(+)
>>
>> diff --git a/include/mtd/cfi_flash.h b/include/mtd/cfi_flash.h
>> index 048b477..526898a 100644
>> --- a/include/mtd/cfi_flash.h
>> +++ b/include/mtd/cfi_flash.h
>> @@ -8,6 +8,8 @@
>> #ifndef __CFI_FLASH_H__
>> #define __CFI_FLASH_H__
>>
>> +#ifndef CONFIG_SYS_NO_FLASH
>> +
>
> Hi!
>
> Something tells me this is not the right way to fix things up,
> but I suspect this idea came from flash.h , right ? This legacy
> code is a terrible mess :-(
>
> I'd kinda expect that it'd be always safe to include the cfi_flash.h
> because cfi_flash.h would include flash.h and take care of having all
> the types available (not the case now). I'd also expect to have all
> the CFI command macros available if I include cfi_flash.h, so this new
> ifdef would introduce a surprising behavior for me.
>
> I wonder if we cannot find some better solution instead of adding some
> more ifdefs to the already horrible maze of ifdefs there. What do you
> think please ?
Fully agreed. Please allow me to withdraw this patch and fix it in the
other way. You are always welcome.
Best regards,
Thomas
next prev parent reply other threads:[~2015-10-25 13:29 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-25 3:02 [U-Boot] [PATCH] mtd: do not include cfi_flash.h if no flash Thomas Chou
2015-10-25 4:00 ` Marek Vasut
2015-10-25 13:29 ` Thomas Chou [this message]
2015-10-25 13:30 ` Marek Vasut
2015-10-25 23:15 ` Thomas Chou
2015-10-25 23:25 ` Marek Vasut
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=562CD922.1050503@wytron.com.tw \
--to=thomas@wytron.com.tw \
--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