mirror of
https://github.com/reactos/reactos.git
synced 2024-11-01 12:26:32 +00:00
[FREELDR] Simplify some control branches in loops (#7417)
Collapse some tests; remove redundant `continue;` Pointed out by Serge Gautherie.
This commit is contained in:
parent
5ed33debf4
commit
3b928898ef
|
@ -605,22 +605,13 @@ PcDiskReadLogicalSectorsLBA(
|
|||
|
||||
Int386(0x13, &RegsIn, &RegsOut);
|
||||
|
||||
/* If it worked return TRUE */
|
||||
if (INT386_SUCCESS(RegsOut))
|
||||
{
|
||||
/* If it worked, or if it was a corrected ECC error
|
||||
* and the data is still good, return success */
|
||||
if (INT386_SUCCESS(RegsOut) || (RegsOut.b.ah == 0x11))
|
||||
return TRUE;
|
||||
}
|
||||
/* If it was a corrected ECC error then the data is still good */
|
||||
else if (RegsOut.b.ah == 0x11)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
/* If it failed then do the next retry */
|
||||
else
|
||||
{
|
||||
DiskResetController(DriveNumber);
|
||||
continue;
|
||||
}
|
||||
|
||||
/* It failed, do the next retry */
|
||||
DiskResetController(DriveNumber);
|
||||
}
|
||||
|
||||
/* If we get here then the read failed */
|
||||
|
@ -715,22 +706,13 @@ PcDiskReadLogicalSectorsCHS(
|
|||
{
|
||||
Int386(0x13, &RegsIn, &RegsOut);
|
||||
|
||||
/* If it worked break out */
|
||||
if (INT386_SUCCESS(RegsOut))
|
||||
{
|
||||
/* If it worked, or if it was a corrected ECC error
|
||||
* and the data is still good, break out */
|
||||
if (INT386_SUCCESS(RegsOut) || (RegsOut.b.ah == 0x11))
|
||||
break;
|
||||
}
|
||||
/* If it was a corrected ECC error then the data is still good */
|
||||
else if (RegsOut.b.ah == 0x11)
|
||||
{
|
||||
break;
|
||||
}
|
||||
/* If it failed then do the next retry */
|
||||
else
|
||||
{
|
||||
DiskResetController(DriveNumber);
|
||||
continue;
|
||||
}
|
||||
|
||||
/* It failed, do the next retry */
|
||||
DiskResetController(DriveNumber);
|
||||
}
|
||||
|
||||
/* If we retried 3 times then fail */
|
||||
|
|
|
@ -219,22 +219,13 @@ Pc98DiskReadLogicalSectorsLBA(
|
|||
{
|
||||
Int386(0x1B, &RegsIn, &RegsOut);
|
||||
|
||||
/* If it worked return TRUE */
|
||||
if (INT386_SUCCESS(RegsOut))
|
||||
{
|
||||
/* If it worked, or if it was a corrected ECC error
|
||||
* and the data is still good, return success */
|
||||
if (INT386_SUCCESS(RegsOut) || (RegsOut.b.ah == 0x08))
|
||||
return TRUE;
|
||||
}
|
||||
/* If it was a corrected ECC error then the data is still good */
|
||||
else if (RegsOut.b.ah == 0x08)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
/* If it failed the do the next retry */
|
||||
else
|
||||
{
|
||||
DiskResetController(DiskDrive);
|
||||
continue;
|
||||
}
|
||||
|
||||
/* It failed, do the next retry */
|
||||
DiskResetController(DiskDrive);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -668,7 +668,8 @@ BOOLEAN FatSearchDirectoryBufferForFile(PFAT_VOLUME_INFO Volume, PVOID Directory
|
|||
// See if the file name matches either the short or long name
|
||||
//
|
||||
if (((strlen(FileName) == strlen(LfnNameBuffer)) && (_stricmp(FileName, LfnNameBuffer) == 0)) ||
|
||||
((strlen(FileName) == strlen(ShortNameBuffer)) && (_stricmp(FileName, ShortNameBuffer) == 0))) {
|
||||
((strlen(FileName) == strlen(ShortNameBuffer)) && (_stricmp(FileName, ShortNameBuffer) == 0)))
|
||||
{
|
||||
//
|
||||
// We found the entry, now fill in the FAT_FILE_INFO struct
|
||||
//
|
||||
|
@ -702,7 +703,6 @@ BOOLEAN FatSearchDirectoryBufferForFile(PFAT_VOLUME_INFO Volume, PVOID Directory
|
|||
//
|
||||
RtlZeroMemory(ShortNameBuffer, 13 * sizeof(UCHAR));
|
||||
RtlZeroMemory(LfnNameBuffer, 261 * sizeof(UCHAR));
|
||||
continue;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
|
|
Loading…
Reference in a new issue