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 17/30] cramfs: make cramfs usable without a NOR flash
Date: Tue, 03 May 2011 07:49:20 +0200	[thread overview]
Message-ID: <4DBF9760.5030607@denx.de> (raw)
In-Reply-To: <20110430082000.81B78D5270E@gemini.denx.de>

Hello Wolfgang,

Wolfgang Denk wrote:
> Dear Valentin Longchamp,
> 
> In message <e0cad960c27371170bf2d2d4be3362d6665fbbfa.1302272395.git.valentin.longchamp@keymile.com> you wrote:
>> From: Heiko Schocher <hs@denx.de>
>>
>> Signed-off-by: Heiko Schocher <hs@denx.de>
>> cc: Wolfgang Denk <wd@denx.de>
>> cc: Detlev Zundel <dzu@denx.de>
>> cc: Valentin Longchamp <valentin.longchamp@keymile.com>
>> cc: Holger Brunck <holger.brunck@keymile.com>
>> Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
>> ---
>>  common/cmd_cramfs.c |   12 +++++++++++-
>>  fs/cramfs/cramfs.c  |    4 ++++
>>  2 files changed, 15 insertions(+), 1 deletions(-)
>>
>> diff --git a/common/cmd_cramfs.c b/common/cmd_cramfs.c
>> index 8c86dc5..5e1487f 100644
>> --- a/common/cmd_cramfs.c
>> +++ b/common/cmd_cramfs.c
>> @@ -43,7 +43,9 @@
>>  #endif
>>  
>>  #ifdef CONFIG_CRAMFS_CMDLINE
>> -flash_info_t flash_info[1];
>> +#if !defined(CONFIG_SYS_NO_FLASH)
>> +#include <flash.h>
>> +#endif
> 
> Do we need the #ifndef here?  I don;t thik it hurts if we
> unconditionally #include <flash.h> ?

Yep, you are right.

> But note: there was no "extern" in this declaration of flash_info[],
> i. e. we _did_ allocate storage here. Is the new code really
> equivalent? How extensively has it been tested?

flash_info is defined in the flash driver, so this is OK.
It is tested on the keymile boards, and a MAKEALL runs
clean.

>>  #ifndef CONFIG_CMD_JFFS2
>>  #include <linux/stat.h>
>> @@ -119,7 +121,11 @@ int do_cramfs_load(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
>>  	dev.id = &id;
>>  	part.dev = &dev;
>>  	/* fake the address offset */
>> +#if !defined(CONFIG_SYS_NO_FLASH)
>>  	part.offset = addr - flash_info[id.num].start[0];
>> +#else
>> +	part.offset = addr;
>> +#endif
> 
> Sequences like this repeat a number of times. How about 
> 
> #ifdef CONFIG_SYS_NO_FLASH
> # define OFFSET_ADJUSTMENT(x)	0
> #else
> # define OFFSET_ADJUSTMENT(x)	(flash_info[id.num].start[x])
> #endif
> ...
> 	dev.id = &id;
> 	part.dev = &dev;
> 	/* fake the address offset */
> 	part.offset = addr - OFFSET_ADJUSTMENT(0);

Yep, that looks better, I change this.

>> +#if !defined(CONFIG_SYS_NO_FLASH)
>>  	part.offset = addr - flash_info[id.num].start[0];
>> +#else
>> +	part.offset = addr;
>> +#endif
> 
> 	part.offset = addr - OFFSET_ADJUSTMENT(0);
> 
>>  extern flash_info_t flash_info[];
>>  #define PART_OFFSET(x)	(x->offset + flash_info[x->dev->id->num].start[0])
>> +#else
>> +#define PART_OFFSET(x)	(x->offset)
> 
> #define PART_OFFSET(x)	(x->offset + OFFSET_ADJUSTMENT(0))
> 
> 
> [If we always refer to start[0] only, we can even omit the argument.]

Yep.

Wolfgang? Is it OK, to send a v2 which is not in this patchseries,
as I think this is an independent patch?

bye,
Heiko
-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

  reply	other threads:[~2011-05-03  5:49 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-08 14:23 [U-Boot] [PATCH 00/30] Keymile boards mainlining, part 2 (resend) Valentin Longchamp
2011-04-08 14:23 ` [U-Boot] [PATCH 01/30] lib, vsprintf: introduce strict_strtoul Valentin Longchamp
2011-04-29 23:15   ` Wolfgang Denk
2011-05-03  7:33   ` [U-Boot] [PATCH v2] " Heiko Schocher
2011-05-12 19:07     ` Wolfgang Denk
2011-04-08 14:23 ` [U-Boot] [PATCH 02/30] powerpc/km82xx: add DIP switch detection Valentin Longchamp
2011-04-08 14:23 ` [U-Boot] [PATCH 03/30] km/common: remove hdlc_enet implementation Valentin Longchamp
2011-04-08 14:23 ` [U-Boot] [PATCH 04/30] powerpc/km82xx: cleanup coding style for mgcoge.c Valentin Longchamp
2011-04-08 14:23 ` [U-Boot] [PATCH 05/30] powerpc/km82xx: rename mgcoge files to km82xx Valentin Longchamp
2011-04-08 14:23 ` [U-Boot] [PATCH 06/30] powerpc/km82xx: move SDRAM config to board config Valentin Longchamp
2011-04-30  7:56   ` Wolfgang Denk
2011-05-02  8:04     ` Holger Brunck
2011-05-02  8:39       ` Wolfgang Denk
2011-04-08 14:23 ` [U-Boot] [PATCH 07/30] powerpc/km82xx: adapt CONFIG_SYSSYPCR to manual Valentin Longchamp
2011-04-08 14:23 ` [U-Boot] [PATCH 08/30] powerpc/km82xx: rename mgcoge2ne to mgcoge3ne board support Valentin Longchamp
2011-04-30  8:05   ` Wolfgang Denk
2011-05-02  8:20     ` Holger Brunck
2011-05-02  8:42       ` Wolfgang Denk
2011-05-02  9:22         ` Holger Brunck
2011-05-10 20:45           ` Wolfgang Denk
2011-04-08 14:23 ` [U-Boot] [PATCH 09/30] poweprc/km82xx: add board specific environment variable Valentin Longchamp
2011-04-08 14:24 ` [U-Boot] [PATCH 10/30] arm/km: add addbootcount " Valentin Longchamp
2011-04-30  8:09   ` Wolfgang Denk
2011-05-02  8:22     ` Holger Brunck
2011-04-08 14:24 ` [U-Boot] [PATCH 11/30] arm/km: remove last_stage_init and unneeded printouts Valentin Longchamp
2011-04-08 14:24 ` [U-Boot] [PATCH 12/30] arm/km: add CRAMFS support for keymile boards Valentin Longchamp
2011-04-08 14:24 ` [U-Boot] [PATCH 13/30] arm/km: add mkimage config file for uart download Valentin Longchamp
2011-04-08 14:24 ` [U-Boot] [PATCH 14/30] arm/km: add BootROM config files for memphis SDRAM Valentin Longchamp
2011-04-08 14:24 ` [U-Boot] [PATCH 15/30] arm/km: disable ls (through jffs2 support) Valentin Longchamp
2011-04-08 14:24 ` [U-Boot] [PATCH 16/30] arm/km: add second serial interface for kirkwood Valentin Longchamp
2011-04-08 14:24 ` [U-Boot] [PATCH 17/30] cramfs: make cramfs usable without a NOR flash Valentin Longchamp
2011-04-30  8:20   ` Wolfgang Denk
2011-05-03  5:49     ` Heiko Schocher [this message]
2011-05-03 11:48       ` Wolfgang Denk
2011-05-03 12:15   ` [U-Boot] [PATCH v2 1/2] cramfs: fix bug in using CONFIG_CRAMFS_CMDLINE Heiko Schocher
2011-05-10 20:47     ` Wolfgang Denk
2011-05-03 12:15   ` [U-Boot] [PATCH v2 2/2] cramfs: make cramfs usable without a NOR flash Heiko Schocher
2011-05-10 20:47     ` Wolfgang Denk
2011-04-08 14:24 ` [U-Boot] [PATCH 18/30] i2c: add i2c deblock sequence before and after every mux config Valentin Longchamp
2011-04-28 17:26   ` Heiko Schocher
2011-04-08 14:24 ` [U-Boot] [PATCH 19/30] i2c, soft_i2c: deblock bus if switching to another i2c bus Valentin Longchamp
2011-04-28 17:26   ` Heiko Schocher
2011-04-08 14:24 ` [U-Boot] [PATCH 20/30] km/common: fix initial_boot_bank for bootpackages Valentin Longchamp
2011-04-08 14:24 ` [U-Boot] [PATCH 21/30] common/hush: make get_local_var visible for other users Valentin Longchamp
2011-04-30  8:22   ` Wolfgang Denk
2011-05-02  5:23     ` Heiko Schocher
2011-05-02  5:40       ` Wolfgang Denk
2011-04-08 14:24 ` [U-Boot] [PATCH 22/30] km/common: implement setboardid as a command Valentin Longchamp
2011-04-30  8:25   ` Wolfgang Denk
2011-05-02  7:32     ` Holger Brunck
2011-04-08 14:24 ` [U-Boot] [PATCH 23/30] km/common: replace env var checkboardidlist by function Valentin Longchamp
2011-04-30  8:29   ` Wolfgang Denk
2011-05-02  8:30     ` Holger Brunck
2011-05-02  8:43       ` Wolfgang Denk
2011-04-08 14:24 ` [U-Boot] [PATCH 24/30] km/common: add pnvramsize to default environment Valentin Longchamp
2011-04-30  8:32   ` Wolfgang Denk
2011-05-02  7:41     ` Holger Brunck
2011-04-08 14:24 ` [U-Boot] [PATCH 25/30] km/common: fix coding style issues in generic header Valentin Longchamp
2011-04-08 14:24 ` [U-Boot] [PATCH 26/30] arm, powerpc, keymile boards: move keymile specific header in subdir Valentin Longchamp
2011-04-08 14:24 ` [U-Boot] [PATCH 27/30] km/common: simplify default environment Valentin Longchamp
2011-04-08 14:24 ` [U-Boot] [PATCH 28/30] arm/km: rename mgcoge2un to mgcoge3un Valentin Longchamp
2011-04-08 14:24 ` [U-Boot] [PATCH 29/30] arm/km: change default settings for egiga on mgcoge3un Valentin Longchamp
2011-04-08 14:24 ` [U-Boot] [PATCH 30/30] arm/km: update mgcoge3un board support Valentin Longchamp
2011-05-03  8:17 ` [U-Boot] [PATCH 00/30] Keymile boards mainlining, part 2 (resend) Valentin Longchamp

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=4DBF9760.5030607@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