public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "gaoliming" <gaoliming@byosoft.com.cn>
To: <devel@edk2.groups.io>, <xiewenyi2@huawei.com>,
	<jian.j.wang@intel.com>, <hao.a.wu@intel.com>,
	<dandan.bi@intel.com>, <eric.dong@intel.com>
Cc: <songdongkuang@huawei.com>
Subject: 回复: [edk2-devel] [PATCH EDK2 v1 1/1] MdeModulePkg/FileExplorerLib: remove redundant null pointer check
Date: Wed, 25 Nov 2020 11:26:47 +0800	[thread overview]
Message-ID: <007d01d6c2da$ce8db1e0$6ba915a0$@byosoft.com.cn> (raw)
In-Reply-To: <1606269171-21979-2-git-send-email-xiewenyi2@huawei.com>

Agree this change. Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>

This patch can be merged after the stable tag 202011. 

Thanks
Liming
> -----邮件原件-----
> 发件人: bounce+27952+67917+4905953+8761045@groups.io
> <bounce+27952+67917+4905953+8761045@groups.io> 代表 wenyi,xie via
> groups.io
> 发送时间: 2020年11月25日 9:53
> 收件人: devel@edk2.groups.io; jian.j.wang@intel.com; hao.a.wu@intel.com;
> dandan.bi@intel.com; eric.dong@intel.com
> 抄送: songdongkuang@huawei.com; xiewenyi2@huawei.com
> 主题: [edk2-devel] [PATCH EDK2 v1 1/1] MdeModulePkg/FileExplorerLib:
> remove redundant null pointer check
> 
> Since Info is a pointer of struct EFI_FILE_SYSTEM_VOLUME_LABEL,
> and this struct has only one member VolumeLabel which is char
> array. So Info and Info->VolumeLabel are point to the same
> address, and if Info != NULL, Info->VolumeLabel == NULL is
> always false, it's no necessary to do null pointer check again.
> 
> 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>
> ---
>  MdeModulePkg/Library/FileExplorerLib/FileExplorer.c | 10 +++-------
>  1 file changed, 3 insertions(+), 7 deletions(-)
> 
> diff --git a/MdeModulePkg/Library/FileExplorerLib/FileExplorer.c
> b/MdeModulePkg/Library/FileExplorerLib/FileExplorer.c
> index 58e49102593c..13a214b06af9 100644
> --- a/MdeModulePkg/Library/FileExplorerLib/FileExplorer.c
> +++ b/MdeModulePkg/Library/FileExplorerLib/FileExplorer.c
> @@ -821,13 +821,9 @@ LibFindFileSystem (
>        if (Info == NULL) {
>          VolumeLabel = L"NO FILE SYSTEM INFO";
>        } else {
> -        if (Info->VolumeLabel == NULL) {
> -          VolumeLabel = L"NULL VOLUME LABEL";
> -        } else {
> -          VolumeLabel = Info->VolumeLabel;
> -          if (*VolumeLabel == 0x0000) {
> -            VolumeLabel = L"NO VOLUME LABEL";
> -          }
> +        VolumeLabel = Info->VolumeLabel;
> +        if (*VolumeLabel == 0x0000) {
> +          VolumeLabel = L"NO VOLUME LABEL";
>          }
>        }
>        MenuEntry->DisplayString  = AllocateZeroPool (MAX_CHAR);
> --
> 2.20.1.windows.1
> 
> 
> 
> 
> 




  reply	other threads:[~2020-11-25  3:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-25  1:52 [PATCH EDK2 v1 0/1] MdeModulePkg/FileExplorerLib: remove redundant null pointer check wenyi,xie
2020-11-25  1:52 ` [PATCH EDK2 v1 1/1] " wenyi,xie
2020-11-25  3:26   ` gaoliming [this message]
2020-11-25 15:01   ` [edk2-devel] " Laszlo Ersek
2020-11-26  1:33     ` wenyi,xie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='007d01d6c2da$ce8db1e0$6ba915a0$@byosoft.com.cn' \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox