From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ulf Samuelsson Date: Sun, 19 Aug 2007 14:51:24 +0200 Subject: [U-Boot-Users] FIX: dataflash.c References: <20070819005029.7D7AD246C5@gemini.denx.de> <46C7B7E4.4000305@gandalf.sssup.it> Message-ID: <001301c7e291$2db6f9d0$dcc4af0a@atmel.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de >>> --- drivers/dataflash.c.orig 2007-08-18 17:36:08.000000000 +0200 >>> +++ drivers/dataflash.c 2007-08-18 17:37:05.000000000 +0200 >>> @@ -27,16 +27,16 @@ AT91S_DATAFLASH_INFO dataflash_info[CFG_ >>> static AT91S_DataFlash DataFlashInst; >>> >>> #ifdef CONFIG_AT91SAM9260EK >>> -int cs[][CFG_MAX_DATAFLASH_BANKS] = { >>> +int cs[][2] = { >>> {CFG_DATAFLASH_LOGIC_ADDR_CS0, 0}, /* Logical adress, CS */ >>> {CFG_DATAFLASH_LOGIC_ADDR_CS1, 1} >>> }; >>> #elif defined(CONFIG_AT91SAM9263EK) >>> -int cs[][CFG_MAX_DATAFLASH_BANKS] = { >>> +int cs[][2] = { >>> {CFG_DATAFLASH_LOGIC_ADDR_CS0, 0} /* Logical adress, CS */ >>> }; >>> #else >>> -int cs[][CFG_MAX_DATAFLASH_BANKS] = { >>> +int cs[][2] = { >>> {CFG_DATAFLASH_LOGIC_ADDR_CS0, 0}, /* Logical adress, CS */ >>> {CFG_DATAFLASH_LOGIC_ADDR_CS3, 3} >>> }; >>> >> >> I hereby reject this patch. >> >> Replacing a configuration option by a hardwired constant which is >> probably wrong on most of the boards is definitely a Bad Thing. >> > The length of the array row is fixed and it is two... It can't be different. > Yes, but that means that you leave the config/*.h info dangling. With the current code you can see how many dataflash are supported. I agree with Wolfgang (wow, that is an experience!) that the patch should be rejected. Best Regards Ulf Samuelsson