summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaszlo Ersek <lersek@redhat.com>2017-09-10 00:42:02 +0200
committerLaszlo Ersek <lersek@redhat.com>2017-09-12 12:12:31 +0200
commitb4e5807d2492efd9fc453b0a09a50f4c3ae77be1 (patch)
tree9b242b22a89d9cf30a48910f38726f678e363a7a
parentb19aeeb91e3c548a7f42828f4d474e23ae6b59b8 (diff)
downloadedk2-b4e5807d2492efd9fc453b0a09a50f4c3ae77be1.tar.gz
edk2-b4e5807d2492efd9fc453b0a09a50f4c3ae77be1.tar.bz2
edk2-b4e5807d2492efd9fc453b0a09a50f4c3ae77be1.zip
MdeModulePkg/PartitionDxe: remove always false comparison
In the expression (RemainderByMediaBlockSize != 0 || Media->BlockSize > UDF_LOGICAL_SECTOR_SIZE) the second expression is only evaluated if the first expression is false. If the first expression is false, i.e., RemainderByMediaBlockSize == 0 then UDF_LOGICAL_SECTOR_SIZE is a whole multiple of "Media->BlockSize", which implies UDF_LOGICAL_SECTOR_SIZE >= Media->BlockSize. Therefore whenever Media->BlockSize > UDF_LOGICAL_SECTOR_SIZE is evaluated, it is false. The expression ((expression) || FALSE) is equivalent to (expression). Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Eric Dong <eric.dong@intel.com> Cc: Paulo Alcantara <pcacjr@zytor.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Paulo Alcantara <pcacjr@zytor.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
-rw-r--r--MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c b/MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c
index e46cf1d4f4..7856b5dfc1 100644
--- a/MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c
+++ b/MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c
@@ -261,8 +261,7 @@ PartitionInstallUdfChildHandles (
Media->BlockSize, // Divisor
&RemainderByMediaBlockSize // Remainder
);
- if (RemainderByMediaBlockSize != 0 ||
- Media->BlockSize > UDF_LOGICAL_SECTOR_SIZE) {
+ if (RemainderByMediaBlockSize != 0) {
return EFI_NOT_FOUND;
}