diff options
author | Hao Wu <hao.a.wu@intel.com> | 2018-10-15 10:26:08 +0800 |
---|---|---|
committer | Hao Wu <hao.a.wu@intel.com> | 2018-10-18 09:13:40 +0800 |
commit | 5317e9ccafed5a031c18293caa06b660af3e9a85 (patch) | |
tree | 571b8decd8d965855cc1eab7f298016002aecde6 | |
parent | 11941d3b1bfab594ff108ddbfed61bc31e8eb674 (diff) | |
download | edk2-5317e9ccafed5a031c18293caa06b660af3e9a85.tar.gz edk2-5317e9ccafed5a031c18293caa06b660af3e9a85.tar.bz2 edk2-5317e9ccafed5a031c18293caa06b660af3e9a85.zip |
MdeModulePkg/UdfDxe: Handle dead codes in FileSystemOperations.c
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1249
We found potential dead codes within File.c during the code coverage test.
After manual review, we think the below ones are positive reports:
A. For function GetAllocationDescriptor():
Due to the all the calling places for this function, the input parameter
'RecordingFlags' can only with value 'LongAdsSequence' or
'ShortAdsSequence'. Moreover, this is also mentioned in the function
description comments for GetAllocationDescriptor().
So the below code will never be reached:
return EFI_DEVICE_ERROR;
This commit will add "ASSERT (FALSE);" before the above line to indicate
this and thus matching the function description comments.
B. For function GetAllocationDescriptorLsn():
Due to the all the calling places for this function, the input parameter
'RecordingFlags' can only with value 'LongAdsSequence' or
'ShortAdsSequence'. Moreover, this is also mentioned in the function
description comments for GetAllocationDescriptorLsn().
So the below code will never be reached:
return EFI_UNSUPPORTED;
This commit will add "ASSERT (FALSE);" before the above line to indicate
this and thus matching the function description comments.
Cc: Paulo Alcantara <palcantara@suse.de>
Cc: Paulo Alcantara <paulo@paulo.ac>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
-rw-r--r-- | MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c b/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c index 1400846bf1..9048a18f64 100644 --- a/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c +++ b/MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c @@ -738,6 +738,10 @@ GetAllocationDescriptor ( );
}
+ //
+ // Code should never reach here.
+ //
+ ASSERT (FALSE);
return EFI_DEVICE_ERROR;
}
@@ -784,6 +788,10 @@ GetAllocationDescriptorLsn ( return EFI_SUCCESS;
}
+ //
+ // Code should never reach here.
+ //
+ ASSERT (FALSE);
return EFI_UNSUPPORTED;
}
|