keucr: fixes open brace should be on the previous line error

This patch fixes the following checkpatch error,
ERROR: that open brace { should be on the previous line

Signed-off-by: Amarjargal Gundjalam <amarjargal16@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Amarjargal Gundjalam 2013-05-17 01:02:50 -07:00 committed by Greg Kroah-Hartman
parent 2ef0b9c110
commit 23f73b3a0e
1 changed files with 140 additions and 156 deletions

View File

@ -99,10 +99,8 @@ int SM_FreeMem(void)
int i; int i;
pr_info("SM_FreeMem start\n"); pr_info("SM_FreeMem start\n");
for (i=0; i<MAX_ZONENUM; i++) for (i=0; i<MAX_ZONENUM; i++) {
{ if (Log2Phy[i]!=NULL) {
if (Log2Phy[i]!=NULL)
{
pr_info("Free Zone = %x, Addr = %p\n", i, Log2Phy[i]); pr_info("Free Zone = %x, Addr = %p\n", i, Log2Phy[i]);
kfree(Log2Phy[i]); kfree(Log2Phy[i]);
Log2Phy[i] = NULL; Log2Phy[i] = NULL;
@ -155,8 +153,7 @@ int Media_D_ReadSector(struct us_data *us, DWORD start,WORD count,BYTE *buf)
if (Conv_D_MediaAddr(us, start)) if (Conv_D_MediaAddr(us, start))
return ErrCode; return ErrCode;
while(1) while(1) {
{
len = Ssfdc.MaxSectors - Media.Sector; len = Ssfdc.MaxSectors - Media.Sector;
if (count > len) if (count > len)
bn = len; bn = len;
@ -164,8 +161,7 @@ int Media_D_ReadSector(struct us_data *us, DWORD start,WORD count,BYTE *buf)
bn = count; bn = count;
//if (Media_D_ReadOneSect(fdoExt, SectBuf)) //if (Media_D_ReadOneSect(fdoExt, SectBuf))
//if (Media_D_ReadOneSect(fdoExt, count, buf)) //if (Media_D_ReadOneSect(fdoExt, count, buf))
if (Media_D_ReadOneSect(us, bn, buf)) if (Media_D_ReadOneSect(us, bn, buf)) {
{
ErrCode = ERR_EccReadErr; ErrCode = ERR_EccReadErr;
return ErrCode; return ErrCode;
} }
@ -198,8 +194,7 @@ int Media_D_CopySector(struct us_data *us, DWORD start,WORD count,BYTE *buf)
if (Conv_D_MediaAddr(us, start)) if (Conv_D_MediaAddr(us, start))
return ErrCode; return ErrCode;
while(1) while(1) {
{
if (Assign_D_WriteBlock()) if (Assign_D_WriteBlock())
return ERROR; return ERROR;
@ -210,18 +205,15 @@ int Media_D_CopySector(struct us_data *us, DWORD start,WORD count,BYTE *buf)
bn = count; bn = count;
//if (Ssfdc_D_CopyBlock(fdoExt,count,buf,Redundant)) //if (Ssfdc_D_CopyBlock(fdoExt,count,buf,Redundant))
if (Ssfdc_D_CopyBlock(us,bn,buf,Redundant)) if (Ssfdc_D_CopyBlock(us,bn,buf,Redundant)) {
{
ErrCode = ERR_WriteFault; ErrCode = ERR_WriteFault;
return ErrCode; return ErrCode;
} }
Media.Sector = 0x1F; Media.Sector = 0x1F;
//if (Release_D_ReadBlock(fdoExt)) //if (Release_D_ReadBlock(fdoExt))
if (Release_D_CopySector(us)) if (Release_D_CopySector(us)) {
{ if (ErrCode==ERR_HwError) {
if (ErrCode==ERR_HwError)
{
ErrCode = ERR_WriteFault; ErrCode = ERR_WriteFault;
return ErrCode; return ErrCode;
} }
@ -249,8 +241,7 @@ int Release_D_CopySector(struct us_data *us)
Log2Phy[Media.Zone][Media.LogBlock]=WriteBlock; Log2Phy[Media.Zone][Media.LogBlock]=WriteBlock;
Media.PhyBlock=ReadBlock; Media.PhyBlock=ReadBlock;
if (Media.PhyBlock==NO_ASSIGN) if (Media.PhyBlock==NO_ASSIGN) {
{
Media.PhyBlock=WriteBlock; Media.PhyBlock=WriteBlock;
return SMSUCCESS; return SMSUCCESS;
} }
@ -664,15 +655,13 @@ int Check_D_MediaFmt(struct us_data *us)
SectCopyMode = COMPLETED; SectCopyMode = COMPLETED;
//usleep(56*1024); //usleep(56*1024);
if (Set_D_PhyFmtValue(us)) if (Set_D_PhyFmtValue(us)) {
{
ErrCode = ERR_UnknownMedia; ErrCode = ERR_UnknownMedia;
return ERROR; return ERROR;
} }
//usleep(56*1024); //usleep(56*1024);
if (Search_D_CIS(us)) if (Search_D_CIS(us)) {
{
ErrCode = ERR_IllegalFmt; ErrCode = ERR_IllegalFmt;
return ERROR; return ERROR;
} }
@ -746,10 +735,8 @@ int Conv_D_MediaAddr(struct us_data *us, DWORD addr)
temp = addr/Ssfdc.MaxSectors; temp = addr/Ssfdc.MaxSectors;
Media.Zone = (BYTE) (temp/Ssfdc.MaxLogBlocks); Media.Zone = (BYTE) (temp/Ssfdc.MaxLogBlocks);
if (Log2Phy[Media.Zone]==NULL) if (Log2Phy[Media.Zone]==NULL) {
{ if (Make_D_LogTable(us)) {
if (Make_D_LogTable(us))
{
ErrCode = ERR_IllegalFmt; ErrCode = ERR_IllegalFmt;
return ERROR; return ERROR;
} }
@ -758,8 +745,7 @@ int Conv_D_MediaAddr(struct us_data *us, DWORD addr)
Media.Sector = (BYTE) (addr%Ssfdc.MaxSectors); Media.Sector = (BYTE) (addr%Ssfdc.MaxSectors);
Media.LogBlock = (WORD) (temp%Ssfdc.MaxLogBlocks); Media.LogBlock = (WORD) (temp%Ssfdc.MaxLogBlocks);
if (Media.Zone<Ssfdc.MaxZones) if (Media.Zone<Ssfdc.MaxZones) {
{
Clr_D_RedundantData(Redundant); Clr_D_RedundantData(Redundant);
Set_D_LogBlockAddr(Redundant); Set_D_LogBlockAddr(Redundant);
Media.PhyBlock = Log2Phy[Media.Zone][Media.LogBlock]; Media.PhyBlock = Log2Phy[Media.Zone][Media.LogBlock];
@ -780,10 +766,8 @@ int Inc_D_MediaAddr(struct us_data *us)
if (++Media.Sector<Ssfdc.MaxSectors) if (++Media.Sector<Ssfdc.MaxSectors)
return SMSUCCESS; return SMSUCCESS;
if (Log2Phy[Media.Zone]==NULL) if (Log2Phy[Media.Zone]==NULL) {
{ if (Make_D_LogTable(us)) {
if (Make_D_LogTable(us))
{
ErrCode = ERR_IllegalFmt; ErrCode = ERR_IllegalFmt;
return ERROR; return ERROR;
} }
@ -792,8 +776,7 @@ int Inc_D_MediaAddr(struct us_data *us)
Media.Sector=0; Media.Sector=0;
Media.LogBlock = LogBlock; Media.LogBlock = LogBlock;
if (++Media.LogBlock<Ssfdc.MaxLogBlocks) if (++Media.LogBlock<Ssfdc.MaxLogBlocks) {
{
Clr_D_RedundantData(Redundant); Clr_D_RedundantData(Redundant);
Set_D_LogBlockAddr(Redundant); Set_D_LogBlockAddr(Redundant);
Media.PhyBlock=Log2Phy[Media.Zone][Media.LogBlock]; Media.PhyBlock=Log2Phy[Media.Zone][Media.LogBlock];
@ -802,12 +785,9 @@ int Inc_D_MediaAddr(struct us_data *us)
Media.LogBlock=0; Media.LogBlock=0;
if (++Media.Zone<Ssfdc.MaxZones) if (++Media.Zone<Ssfdc.MaxZones) {
{ if (Log2Phy[Media.Zone]==NULL) {
if (Log2Phy[Media.Zone]==NULL) if (Make_D_LogTable(us)) {
{
if (Make_D_LogTable(us))
{
ErrCode = ERR_IllegalFmt; ErrCode = ERR_IllegalFmt;
return ERROR; return ERROR;
} }
@ -865,18 +845,15 @@ int Media_D_ReadOneSect(struct us_data *us, WORD count, BYTE *buf)
return ERROR; return ERROR;
#ifdef RDERR_REASSIGN #ifdef RDERR_REASSIGN
if (Ssfdc.Attribute &MWP) if (Ssfdc.Attribute &MWP) {
{
if (ErrCode==ERR_CorReadErr) if (ErrCode==ERR_CorReadErr)
return SMSUCCESS; return SMSUCCESS;
return ERROR; return ERROR;
} }
err=ErrCode; err=ErrCode;
for(retry=0; retry<2; retry++) for(retry=0; retry<2; retry++) {
{ if (Copy_D_BlockAll(us, (err==ERR_EccReadErr)?REQ_FAIL:REQ_ERASE)) {
if (Copy_D_BlockAll(us, (err==ERR_EccReadErr)?REQ_FAIL:REQ_ERASE))
{
if (ErrCode==ERR_HwError) if (ErrCode==ERR_HwError)
return ERROR; return ERROR;
continue; continue;
@ -1090,10 +1067,8 @@ int Copy_D_BlockAll(struct us_data *us, DWORD mode)
if (mode==REQ_FAIL) if (mode==REQ_FAIL)
SectCopyMode=REQ_FAIL; SectCopyMode=REQ_FAIL;
for(Media.Sector=0; Media.Sector<Ssfdc.MaxSectors; Media.Sector++) for(Media.Sector=0; Media.Sector<Ssfdc.MaxSectors; Media.Sector++) {
{ if (Copy_D_PhyOneSect(us)) {
if (Copy_D_PhyOneSect(us))
{
if (ErrCode==ERR_HwError) if (ErrCode==ERR_HwError)
return ERROR; return ERROR;
if (Release_D_WriteBlock(us)) if (Release_D_WriteBlock(us))
@ -1233,10 +1208,8 @@ int Assign_D_WriteBlock(void)
//ADDRESS_T bb = (ADDRESS_T) &Media; //ADDRESS_T bb = (ADDRESS_T) &Media;
ReadBlock=Media.PhyBlock; ReadBlock=Media.PhyBlock;
for(WriteBlock=AssignStart[Media.Zone]; WriteBlock<Ssfdc.MaxBlocks; WriteBlock++) for(WriteBlock=AssignStart[Media.Zone]; WriteBlock<Ssfdc.MaxBlocks; WriteBlock++) {
{ if (!Chk_D_Bit(Assign[Media.Zone],WriteBlock)) {
if (!Chk_D_Bit(Assign[Media.Zone],WriteBlock))
{
Set_D_Bit(Assign[Media.Zone],WriteBlock); Set_D_Bit(Assign[Media.Zone],WriteBlock);
AssignStart[Media.Zone]=WriteBlock+1; AssignStart[Media.Zone]=WriteBlock+1;
Media.PhyBlock=WriteBlock; Media.PhyBlock=WriteBlock;
@ -1246,10 +1219,8 @@ int Assign_D_WriteBlock(void)
} }
} }
for(WriteBlock=0; WriteBlock<AssignStart[Media.Zone]; WriteBlock++) for(WriteBlock=0; WriteBlock<AssignStart[Media.Zone]; WriteBlock++) {
{ if (!Chk_D_Bit(Assign[Media.Zone],WriteBlock)) {
if (!Chk_D_Bit(Assign[Media.Zone],WriteBlock))
{
Set_D_Bit(Assign[Media.Zone],WriteBlock); Set_D_Bit(Assign[Media.Zone],WriteBlock);
AssignStart[Media.Zone]=WriteBlock+1; AssignStart[Media.Zone]=WriteBlock+1;
Media.PhyBlock=WriteBlock; Media.PhyBlock=WriteBlock;
@ -1283,16 +1254,13 @@ int Release_D_ReadBlock(struct us_data *us)
Log2Phy[Media.Zone][Media.LogBlock]=WriteBlock; Log2Phy[Media.Zone][Media.LogBlock]=WriteBlock;
Media.PhyBlock=ReadBlock; Media.PhyBlock=ReadBlock;
if (Media.PhyBlock==NO_ASSIGN) if (Media.PhyBlock==NO_ASSIGN) {
{
Media.PhyBlock=WriteBlock; Media.PhyBlock=WriteBlock;
return SMSUCCESS; return SMSUCCESS;
} }
if (mode==REQ_ERASE) if (mode==REQ_ERASE) {
{ if (Erase_D_PhyOneBlock(us)) {
if (Erase_D_PhyOneBlock(us))
{
if (ErrCode==ERR_HwError) return ERROR; if (ErrCode==ERR_HwError) return ERROR;
if (MarkFail_D_PhyOneBlock(us)) return ERROR; if (MarkFail_D_PhyOneBlock(us)) return ERROR;
} }
@ -1331,36 +1299,47 @@ int Copy_D_PhyOneSect(struct us_data *us)
//ADDRESS_T bb = (ADDRESS_T) &Media; //ADDRESS_T bb = (ADDRESS_T) &Media;
/* pr_info("Copy_D_PhyOneSect --- Secotr = %x\n", Media.Sector); */ /* pr_info("Copy_D_PhyOneSect --- Secotr = %x\n", Media.Sector); */
if (ReadBlock!=NO_ASSIGN) if (ReadBlock!=NO_ASSIGN) {
{
Media.PhyBlock=ReadBlock; Media.PhyBlock=ReadBlock;
for(retry=0; retry<2; retry++) for(retry=0; retry<2; retry++) {
{ if (retry!=0) {
if (retry!=0)
{
Ssfdc_D_Reset(us); Ssfdc_D_Reset(us);
if (Ssfdc_D_ReadCisSect(us,WorkBuf,WorkRedund)) if (Ssfdc_D_ReadCisSect(us,WorkBuf,WorkRedund)) {
{ ErrCode = ERR_HwError; MediaChange=ERROR; return ERROR; } ErrCode = ERR_HwError;
MediaChange=ERROR;
return ERROR;
}
if (Check_D_CISdata(WorkBuf,WorkRedund)) if (Check_D_CISdata(WorkBuf,WorkRedund)) {
{ ErrCode = ERR_HwError; MediaChange=ERROR; return ERROR; } ErrCode = ERR_HwError;
MediaChange=ERROR;
return ERROR;
}
} }
if (Ssfdc_D_ReadSect(us,WorkBuf,WorkRedund)) if (Ssfdc_D_ReadSect(us,WorkBuf,WorkRedund)) {
{ ErrCode = ERR_HwError; MediaChange=ERROR; return ERROR; } ErrCode = ERR_HwError;
if (Check_D_DataStatus(WorkRedund)) MediaChange=ERROR;
{ err=ERROR; break; } return ERROR;
if (!Check_D_ReadError(WorkRedund)) }
{ err=SMSUCCESS; break; } if (Check_D_DataStatus(WorkRedund)) {
if (!Check_D_Correct(WorkBuf,WorkRedund)) err=ERROR;
{ err=SMSUCCESS; break; } break;
}
if (!Check_D_ReadError(WorkRedund)) {
err=SMSUCCESS;
break;
}
if (!Check_D_Correct(WorkBuf,WorkRedund)) {
err=SMSUCCESS;
break;
}
err=ERROR; err=ERROR;
SectCopyMode=REQ_FAIL; SectCopyMode=REQ_FAIL;
} }
} }
else else {
{
err=SMSUCCESS; err=SMSUCCESS;
for(i=0; i<SECTSIZE; i++) for(i=0; i<SECTSIZE; i++)
WorkBuf[i]=DUMMY_DATA; WorkBuf[i]=DUMMY_DATA;
@ -1368,18 +1347,22 @@ int Copy_D_PhyOneSect(struct us_data *us)
} }
Set_D_LogBlockAddr(WorkRedund); Set_D_LogBlockAddr(WorkRedund);
if (err==ERROR) if (err==ERROR) {
{
Set_D_RightECC(WorkRedund); Set_D_RightECC(WorkRedund);
Set_D_DataStaus(WorkRedund); Set_D_DataStaus(WorkRedund);
} }
Media.PhyBlock=WriteBlock; Media.PhyBlock=WriteBlock;
if (Ssfdc_D_WriteSectForCopy(us, WorkBuf, WorkRedund)) if (Ssfdc_D_WriteSectForCopy(us, WorkBuf, WorkRedund)) {
{ ErrCode = ERR_HwError; MediaChange=ERROR; return ERROR; } ErrCode = ERR_HwError;
if (Ssfdc_D_CheckStatus()) MediaChange=ERROR;
{ ErrCode = ERR_WriteFault; return ERROR; } return ERROR;
}
if (Ssfdc_D_CheckStatus()) {
ErrCode = ERR_WriteFault;
return ERROR;
}
Media.PhyBlock=ReadBlock; Media.PhyBlock=ReadBlock;
return SMSUCCESS; return SMSUCCESS;
@ -1394,36 +1377,46 @@ int Read_D_PhyOneSect(struct us_data *us, WORD count, BYTE *buf)
//SSFDCTYPE_T aa = (SSFDCTYPE_T ) &Ssfdc; //SSFDCTYPE_T aa = (SSFDCTYPE_T ) &Ssfdc;
//ADDRESS_T bb = (ADDRESS_T) &Media; //ADDRESS_T bb = (ADDRESS_T) &Media;
if (Media.PhyBlock==NO_ASSIGN) if (Media.PhyBlock==NO_ASSIGN) {
{
for(i=0; i<SECTSIZE; i++) for(i=0; i<SECTSIZE; i++)
*buf++=DUMMY_DATA; *buf++=DUMMY_DATA;
return SMSUCCESS; return SMSUCCESS;
} }
for(retry=0; retry<2; retry++) for(retry=0; retry<2; retry++) {
{ if (retry!=0) {
if (retry!=0)
{
Ssfdc_D_Reset(us); Ssfdc_D_Reset(us);
if (Ssfdc_D_ReadCisSect(us,WorkBuf,WorkRedund)) if (Ssfdc_D_ReadCisSect(us,WorkBuf,WorkRedund)) {
{ ErrCode = ERR_HwError; MediaChange=ERROR; return ERROR; } ErrCode = ERR_HwError;
if (Check_D_CISdata(WorkBuf,WorkRedund)) MediaChange=ERROR;
{ ErrCode = ERR_HwError; MediaChange=ERROR; return ERROR; } return ERROR;
}
if (Check_D_CISdata(WorkBuf,WorkRedund)) {
ErrCode = ERR_HwError;
MediaChange=ERROR;
return ERROR;
}
} }
//if (Ssfdc_D_ReadSect(fdoExt,buf,Redundant)) //if (Ssfdc_D_ReadSect(fdoExt,buf,Redundant))
if (Ssfdc_D_ReadBlock(us,count,buf,Redundant)) if (Ssfdc_D_ReadBlock(us,count,buf,Redundant)) {
{ ErrCode = ERR_HwError; MediaChange=ERROR; return ERROR; } ErrCode = ERR_HwError;
if (Check_D_DataStatus(Redundant)) MediaChange=ERROR;
{ ErrCode = ERR_DataStatus; return ERROR; } return ERROR;
}
if (Check_D_DataStatus(Redundant)) {
ErrCode = ERR_DataStatus;
return ERROR;
}
if (!Check_D_ReadError(Redundant)) if (!Check_D_ReadError(Redundant))
return SMSUCCESS; return SMSUCCESS;
if (!Check_D_Correct(buf,Redundant)) if (!Check_D_Correct(buf,Redundant)) {
{ ErrCode = ERR_CorReadErr; return ERROR; } ErrCode = ERR_CorReadErr;
return ERROR;
}
} }
ErrCode = ERR_EccReadErr; ErrCode = ERR_EccReadErr;
@ -1451,10 +1444,15 @@ int Erase_D_PhyOneBlock(struct us_data *us)
//SSFDCTYPE_T aa = (SSFDCTYPE_T ) &Ssfdc; //SSFDCTYPE_T aa = (SSFDCTYPE_T ) &Ssfdc;
//ADDRESS_T bb = (ADDRESS_T) &Media; //ADDRESS_T bb = (ADDRESS_T) &Media;
if (Ssfdc_D_EraseBlock(us)) if (Ssfdc_D_EraseBlock(us)) {
{ ErrCode = ERR_HwError; MediaChange=ERROR; return ERROR; } ErrCode = ERR_HwError;
if (Ssfdc_D_CheckStatus()) MediaChange=ERROR;
{ ErrCode = ERR_WriteFault; return ERROR; } return ERROR;
}
if (Ssfdc_D_CheckStatus()) {
ErrCode = ERR_WriteFault;
return ERROR;
}
return SMSUCCESS; return SMSUCCESS;
} }
@ -1551,10 +1549,8 @@ int Search_D_CIS(struct us_data *us)
Media.Zone=0; Media.Sector=0; Media.Zone=0; Media.Sector=0;
for (Media.PhyBlock=0; Media.PhyBlock<(Ssfdc.MaxBlocks-Ssfdc.MaxLogBlocks-1); Media.PhyBlock++) for (Media.PhyBlock=0; Media.PhyBlock<(Ssfdc.MaxBlocks-Ssfdc.MaxLogBlocks-1); Media.PhyBlock++) {
{ if (Ssfdc_D_ReadRedtData(us, Redundant)) {
if (Ssfdc_D_ReadRedtData(us, Redundant))
{
Ssfdc_D_Reset(us); Ssfdc_D_Reset(us);
return ERROR; return ERROR;
} }
@ -1563,32 +1559,25 @@ int Search_D_CIS(struct us_data *us)
break; break;
} }
if (Media.PhyBlock==(Ssfdc.MaxBlocks-Ssfdc.MaxLogBlocks-1)) if (Media.PhyBlock==(Ssfdc.MaxBlocks-Ssfdc.MaxLogBlocks-1)) {
{
Ssfdc_D_Reset(us); Ssfdc_D_Reset(us);
return ERROR; return ERROR;
} }
while (Media.Sector<CIS_SEARCH_SECT) while (Media.Sector<CIS_SEARCH_SECT) {
{ if (Media.Sector) {
if (Media.Sector) if (Ssfdc_D_ReadRedtData(us, Redundant)) {
{
if (Ssfdc_D_ReadRedtData(us, Redundant))
{
Ssfdc_D_Reset(us); Ssfdc_D_Reset(us);
return ERROR; return ERROR;
} }
} }
if (!Check_D_DataStatus(Redundant)) if (!Check_D_DataStatus(Redundant)) {
{ if (Ssfdc_D_ReadSect(us,WorkBuf,Redundant)) {
if (Ssfdc_D_ReadSect(us,WorkBuf,Redundant))
{
Ssfdc_D_Reset(us); Ssfdc_D_Reset(us);
return ERROR; return ERROR;
} }
if (Check_D_CISdata(WorkBuf,Redundant)) if (Check_D_CISdata(WorkBuf,Redundant)) {
{
Ssfdc_D_Reset(us); Ssfdc_D_Reset(us);
return ERROR; return ERROR;
} }
@ -1613,8 +1602,7 @@ int Make_D_LogTable(struct us_data *us)
//SSFDCTYPE_T aa = (SSFDCTYPE_T ) &Ssfdc; //SSFDCTYPE_T aa = (SSFDCTYPE_T ) &Ssfdc;
//ADDRESS_T bb = (ADDRESS_T) &Media; //ADDRESS_T bb = (ADDRESS_T) &Media;
if (Log2Phy[Media.Zone]==NULL) if (Log2Phy[Media.Zone]==NULL) {
{
Log2Phy[Media.Zone] = kmalloc(MAX_LOGBLOCK*sizeof(WORD), GFP_KERNEL); Log2Phy[Media.Zone] = kmalloc(MAX_LOGBLOCK*sizeof(WORD), GFP_KERNEL);
/* pr_info("ExAllocatePool Zone = %x, Addr = %x\n", /* pr_info("ExAllocatePool Zone = %x, Addr = %x\n",
Media.Zone, Log2Phy[Media.Zone]); */ Media.Zone, Log2Phy[Media.Zone]); */
@ -1635,16 +1623,16 @@ int Make_D_LogTable(struct us_data *us)
for(Media.PhyBlock=0; Media.PhyBlock<(MAX_BLOCKNUM/8); Media.PhyBlock++) for(Media.PhyBlock=0; Media.PhyBlock<(MAX_BLOCKNUM/8); Media.PhyBlock++)
Assign[Media.Zone][Media.PhyBlock]=0x00; Assign[Media.Zone][Media.PhyBlock]=0x00;
for(Media.PhyBlock=0; Media.PhyBlock<Ssfdc.MaxBlocks; Media.PhyBlock++) for(Media.PhyBlock=0; Media.PhyBlock<Ssfdc.MaxBlocks; Media.PhyBlock++) {
{ if ((!Media.Zone) && (Media.PhyBlock<=CisArea.PhyBlock)) {
if ((!Media.Zone) && (Media.PhyBlock<=CisArea.PhyBlock))
{
Set_D_Bit(Assign[Media.Zone],Media.PhyBlock); Set_D_Bit(Assign[Media.Zone],Media.PhyBlock);
continue; continue;
} }
if (Ssfdc_D_ReadRedtData(us, Redundant)) if (Ssfdc_D_ReadRedtData(us, Redundant)) {
{ Ssfdc_D_Reset(us); return ERROR; } Ssfdc_D_Reset(us);
return ERROR;
}
if (!Check_D_DataBlank(Redundant)) if (!Check_D_DataBlank(Redundant))
continue; continue;
@ -1663,8 +1651,7 @@ int Make_D_LogTable(struct us_data *us)
if (Media.LogBlock>=Ssfdc.MaxLogBlocks) if (Media.LogBlock>=Ssfdc.MaxLogBlocks)
continue; continue;
if (Log2Phy[Media.Zone][Media.LogBlock]==NO_ASSIGN) if (Log2Phy[Media.Zone][Media.LogBlock]==NO_ASSIGN) {
{
Log2Phy[Media.Zone][Media.LogBlock]=Media.PhyBlock; Log2Phy[Media.Zone][Media.LogBlock]=Media.PhyBlock;
continue; continue;
} }
@ -1673,30 +1660,29 @@ int Make_D_LogTable(struct us_data *us)
logblock = Media.LogBlock; logblock = Media.LogBlock;
Media.Sector = (BYTE)(Ssfdc.MaxSectors-1); Media.Sector = (BYTE)(Ssfdc.MaxSectors-1);
if (Ssfdc_D_ReadRedtData(us, Redundant)) if (Ssfdc_D_ReadRedtData(us, Redundant)) {
{ Ssfdc_D_Reset(us); return ERROR; } Ssfdc_D_Reset(us);
return ERROR;
}
if (!Load_D_LogBlockAddr(Redundant)) if (!Load_D_LogBlockAddr(Redundant)) {
{ if (Media.LogBlock==logblock) {
if (Media.LogBlock==logblock)
{
Media.PhyBlock=Log2Phy[Media.Zone][logblock]; Media.PhyBlock=Log2Phy[Media.Zone][logblock];
if (Ssfdc_D_ReadRedtData(us, Redundant)) if (Ssfdc_D_ReadRedtData(us, Redundant)) {
{ Ssfdc_D_Reset(us); return ERROR; } Ssfdc_D_Reset(us);
return ERROR;
}
Media.PhyBlock=phyblock; Media.PhyBlock=phyblock;
if (!Load_D_LogBlockAddr(Redundant)) if (!Load_D_LogBlockAddr(Redundant)) {
{ if (Media.LogBlock!=logblock) {
if (Media.LogBlock!=logblock)
{
Media.PhyBlock=Log2Phy[Media.Zone][logblock]; Media.PhyBlock=Log2Phy[Media.Zone][logblock];
Log2Phy[Media.Zone][logblock]=phyblock; Log2Phy[Media.Zone][logblock]=phyblock;
} }
} }
else else {
{
Media.PhyBlock=Log2Phy[Media.Zone][logblock]; Media.PhyBlock=Log2Phy[Media.Zone][logblock];
Log2Phy[Media.Zone][logblock]=phyblock; Log2Phy[Media.Zone][logblock]=phyblock;
} }
@ -1747,10 +1733,8 @@ int MarkFail_D_PhyOneBlock(struct us_data *us)
Set_D_FailBlock(WorkRedund); Set_D_FailBlock(WorkRedund);
//Ssfdc_D_WriteRedtMode(); //Ssfdc_D_WriteRedtMode();
for(Media.Sector=0; Media.Sector<Ssfdc.MaxSectors; Media.Sector++) for(Media.Sector=0; Media.Sector<Ssfdc.MaxSectors; Media.Sector++) {
{ if (Ssfdc_D_WriteRedtData(us, WorkRedund)) {
if (Ssfdc_D_WriteRedtData(us, WorkRedund))
{
Ssfdc_D_Reset(us); Ssfdc_D_Reset(us);
Media.Sector = sect; Media.Sector = sect;
ErrCode = ERR_HwError; ErrCode = ERR_HwError;