mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-04-01 03:51:31 +00:00
[Blackfin][PATCH] minor cleanup
This commit is contained in:
parent
8e709bbb26
commit
a6154fd1cf
1 changed files with 5 additions and 5 deletions
|
@ -330,14 +330,14 @@ int erase_block_flash(int nBlock)
|
||||||
if ((nBlock < 0) || (nBlock > AFP_NumSectors))
|
if ((nBlock < 0) || (nBlock > AFP_NumSectors))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
// figure out the offset of the block in flash
|
/* figure out the offset of the block in flash */
|
||||||
if ((nBlock >= 0) && (nBlock < SecFlashABegin))
|
if ((nBlock >= 0) && (nBlock < SecFlashABegin))
|
||||||
ulSectorOff = nBlock * AFP_SectorSize1;
|
ulSectorOff = nBlock * AFP_SectorSize1;
|
||||||
|
|
||||||
else if ((nBlock >= SecFlashABegin) && (nBlock < NUM_SECTORS))
|
else if ((nBlock >= SecFlashABegin) && (nBlock < NUM_SECTORS))
|
||||||
ulSectorOff =
|
ulSectorOff =
|
||||||
SecFlashAOff + (nBlock - SecFlashABegin) * AFP_SectorSize2;
|
SecFlashAOff + (nBlock - SecFlashABegin) * AFP_SectorSize2;
|
||||||
// no such sector
|
/* no such sector */
|
||||||
else
|
else
|
||||||
return FLASH_FAIL;
|
return FLASH_FAIL;
|
||||||
|
|
||||||
|
@ -388,15 +388,15 @@ void get_sector_number(long ulOffset, int *pnSector)
|
||||||
long lMainEnd = 0x400000;
|
long lMainEnd = 0x400000;
|
||||||
long lBootEnd = 0x10000;
|
long lBootEnd = 0x10000;
|
||||||
|
|
||||||
// sector numbers for the FLASH A boot sectors
|
/* sector numbers for the FLASH A boot sectors */
|
||||||
if (ulOffset < lBootEnd) {
|
if (ulOffset < lBootEnd) {
|
||||||
nSector = (int)ulOffset / AFP_SectorSize1;
|
nSector = (int)ulOffset / AFP_SectorSize1;
|
||||||
}
|
}
|
||||||
// sector numbers for the FLASH B boot sectors
|
/* sector numbers for the FLASH B boot sectors */
|
||||||
else if ((ulOffset >= lBootEnd) && (ulOffset < lMainEnd)) {
|
else if ((ulOffset >= lBootEnd) && (ulOffset < lMainEnd)) {
|
||||||
nSector = ((ulOffset / (AFP_SectorSize2)) + 7);
|
nSector = ((ulOffset / (AFP_SectorSize2)) + 7);
|
||||||
}
|
}
|
||||||
// if it is a valid sector, set it
|
/* if it is a valid sector, set it */
|
||||||
if ((nSector >= 0) && (nSector < AFP_NumSectors))
|
if ((nSector >= 0) && (nSector < AFP_NumSectors))
|
||||||
*pnSector = nSector;
|
*pnSector = nSector;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue