diff options
author | wenyi xie <xiewenyi2=huawei.com@groups.io> | 2020-11-26 09:50:33 +0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2020-12-04 05:56:09 +0000 |
commit | c02bdb276baf8c37a42c87dff68fb0d3f264b124 (patch) | |
tree | 7014be0515305671d87dc292a6162c3937cd2573 /NetworkPkg/Network.fdf.inc | |
parent | 31e8a47b62a4f3dc45d8f9bbf3529a188e867a87 (diff) | |
download | edk2-c02bdb276baf8c37a42c87dff68fb0d3f264b124.tar.gz edk2-c02bdb276baf8c37a42c87dff68fb0d3f264b124.tar.bz2 edk2-c02bdb276baf8c37a42c87dff68fb0d3f264b124.zip |
MdeModulePkg/FileExplorerLib: remove redundant null pointer check
If "Info" is a valid pointer to an EFI_FILE_SYSTEM_VOLUME_LABEL
structure, then "Info->VolumeLabel" denotes a valid array object.
When the "Info->VolumeLabel" expression is evaluated, as seen in
the LibFindFileSystem(), it is implicitly converted to
(&Info->VolumeLabel[0]). Because the object described by the
expression (Info->VolumeLabel[0]) is a valid CHAR16 object, its
address can never compare equal to NULL. Therefore, the condition
(Info->VolumeLabel == NULL) will always evaluate to FALSE.
Substitute the constant FALSE into the "if" statement, and
simplify the resultant code (eliminate the dead branch).
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Signed-off-by: Wenyi Xie <xiewenyi2@huawei.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Diffstat (limited to 'NetworkPkg/Network.fdf.inc')
0 files changed, 0 insertions, 0 deletions