[U-Boot] [PATCH 7/8] mtd: nand: add driver for diskonchip g4 nand flash

Mike Dunn mikedunn at newsguy.com
Mon Apr 8 19:10:12 CEST 2013


On 04/07/2013 11:25 PM, Marek Vasut wrote:
[..]
> Try #ifdef U_BOOT instead of #if 0, no?


Marek, can you clarify?  Do you mean something like...

#define U_BOOT
...
#ifndef U_BOOT  /* Currently u-boot does not have for_each_set_bit */
		unsigned long bits = ~buf[i];
		for_each_set_bit(bitnum, &bits, 8) {
		...
#else
	uint8_t mask;
		for(bitnum = 0, mask = 0x80; bitnum < 8; bitnum++, mask >>= 1) {
			if (!(buf[i] & mask)) {

		...
#endif

Thanks again,
Mike


More information about the U-Boot mailing list