diff options
| author | Marian Balakowicz <m8@semihalf.com> | 2008-02-21 17:18:01 +0100 | 
|---|---|---|
| committer | Marian Balakowicz <m8@semihalf.com> | 2008-02-21 17:18:01 +0100 | 
| commit | 20c93959330aba8b5bbdbfde1ef319e99eba235d (patch) | |
| tree | ef82297e3aeb904f94584e6d136fac55ec32c317 /common/env_dataflash.c | |
| parent | 5cf746c303710329f8040d9c62ee354313e3e91f (diff) | |
| parent | 928d1d77f8623c120d8763e20e1ca58df9c5c4c6 (diff) | |
| download | olio-uboot-2014.01-20c93959330aba8b5bbdbfde1ef319e99eba235d.tar.xz olio-uboot-2014.01-20c93959330aba8b5bbdbfde1ef319e99eba235d.zip | |
Merge branch 'master' of /home/git/u-boot
Diffstat (limited to 'common/env_dataflash.c')
| -rw-r--r-- | common/env_dataflash.c | 17 | 
1 files changed, 9 insertions, 8 deletions
| diff --git a/common/env_dataflash.c b/common/env_dataflash.c index 93fff29b0..8a944324f 100644 --- a/common/env_dataflash.c +++ b/common/env_dataflash.c @@ -44,22 +44,22 @@ extern uchar default_environment[];  uchar env_get_char_spec (int index)  {  	uchar c; -	read_dataflash (CFG_ENV_ADDR+index+offsetof(env_t,data),1,&c); +	read_dataflash(CFG_ENV_ADDR + index + offsetof(env_t,data), +	1, (char *)&c);  	return (c);  }  void env_relocate_spec (void)  { -	read_dataflash (CFG_ENV_ADDR,CFG_ENV_SIZE,(uchar *)env_ptr); +	read_dataflash(CFG_ENV_ADDR, CFG_ENV_SIZE, (char *)env_ptr);  }  int saveenv(void)  { -/* env must be copied to do not alter env structure in memory*/ -unsigned char temp[CFG_ENV_SIZE]; -int i; +	/* env must be copied to do not alter env structure in memory*/ +	unsigned char temp[CFG_ENV_SIZE];  	memcpy(temp, env_ptr, CFG_ENV_SIZE); -	return write_dataflash (CFG_ENV_ADDR, (unsigned long)temp, CFG_ENV_SIZE); +	return write_dataflash(CFG_ENV_ADDR, (unsigned long)temp, CFG_ENV_SIZE);  }  /************************************************************************ @@ -77,13 +77,14 @@ int env_init(void)  		AT91F_DataflashInit();	/* prepare for DATAFLASH read/write */  		/* read old CRC */ -		read_dataflash (CFG_ENV_ADDR+offsetof(env_t,crc),sizeof(ulong),&crc); +		read_dataflash(CFG_ENV_ADDR + offsetof(env_t, crc), +			sizeof(ulong), (char *)&crc);  		new = 0;  		len = ENV_SIZE;  		off = offsetof(env_t,data);  		while (len > 0) {  			int n = (len > sizeof(buf)) ? sizeof(buf) : len; -			read_dataflash (CFG_ENV_ADDR+off,n , buf); +			read_dataflash(CFG_ENV_ADDR + off, n, (char *)buf);  			new = crc32 (new, buf, n);  			len -= n;  			off += n; |