From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.byosoft.com.cn (mail.byosoft.com.cn [58.240.74.242]) by mx.groups.io with SMTP id smtpd.web11.1930.1606274807215242222 for ; Tue, 24 Nov 2020 19:26:48 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=none, err=permanent DNS error (domain: byosoft.com.cn, ip: 58.240.74.242, mailfrom: gaoliming@byosoft.com.cn) Received: from DESKTOPS6D0PVI ([58.246.60.130]) (envelope-sender ) by 192.168.6.13 with ESMTP for ; Wed, 25 Nov 2020 11:26:43 +0800 X-WM-Sender: gaoliming@byosoft.com.cn X-WM-AuthFlag: YES X-WM-AuthUser: gaoliming@byosoft.com.cn From: "gaoliming" To: , , , , , Cc: References: <1606269171-21979-1-git-send-email-xiewenyi2@huawei.com> <1606269171-21979-2-git-send-email-xiewenyi2@huawei.com> In-Reply-To: <1606269171-21979-2-git-send-email-xiewenyi2@huawei.com> Subject: =?UTF-8?B?5Zue5aSNOiBbZWRrMi1kZXZlbF0gW1BBVENIIEVESzIgdjEgMS8xXSBNZGVNb2R1bGVQa2cvRmlsZUV4cGxvcmVyTGliOiByZW1vdmUgcmVkdW5kYW50IG51bGwgcG9pbnRlciBjaGVjaw==?= Date: Wed, 25 Nov 2020 11:26:47 +0800 Message-ID: <007d01d6c2da$ce8db1e0$6ba915a0$@byosoft.com.cn> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQGePO8Fzrcpmr/LUL84/MJSaAkDLAKj45Y3qjQcbFA= Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: quoted-printable Content-Language: zh-cn Agree this change. Reviewed-by: Liming Gao This patch can be merged after the stable tag 202011.=20 Thanks Liming > -----=D3=CA=BC=FE=D4=AD=BC=FE----- > =B7=A2=BC=FE=C8=CB: bounce+27952+67917+4905953+8761045@groups.io > =B4=FA=B1=ED wenyi,xie vi= a > groups.io > =B7=A2=CB=CD=CA=B1=BC=E4: 2020=C4=EA11=D4=C225=C8=D5 9:53 > =CA=D5=BC=FE=C8=CB: devel@edk2.groups.io; jian.j.wang@intel.com; hao.a.w= u@intel.com; > dandan.bi@intel.com; eric.dong@intel.com > =B3=AD=CB=CD: songdongkuang@huawei.com; xiewenyi2@huawei.com > =D6=F7=CC=E2: [edk2-devel] [PATCH EDK2 v1 1/1] MdeModulePkg/FileExplorer= Lib: > remove redundant null pointer check >=20 > 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 !=3D NULL, Info->VolumeLabel =3D=3D NULL is > always false, it's no necessary to do null pointer check again. >=20 > Cc: Jian J Wang > Cc: Hao A Wu > Cc: Dandan Bi > Cc: Eric Dong > Signed-off-by: Wenyi Xie > --- > MdeModulePkg/Library/FileExplorerLib/FileExplorer.c | 10 +++------- > 1 file changed, 3 insertions(+), 7 deletions(-) >=20 > 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 =3D=3D NULL) { > VolumeLabel =3D L"NO FILE SYSTEM INFO"; > } else { > - if (Info->VolumeLabel =3D=3D NULL) { > - VolumeLabel =3D L"NULL VOLUME LABEL"; > - } else { > - VolumeLabel =3D Info->VolumeLabel; > - if (*VolumeLabel =3D=3D 0x0000) { > - VolumeLabel =3D L"NO VOLUME LABEL"; > - } > + VolumeLabel =3D Info->VolumeLabel; > + if (*VolumeLabel =3D=3D 0x0000) { > + VolumeLabel =3D L"NO VOLUME LABEL"; > } > } > MenuEntry->DisplayString =3D AllocateZeroPool (MAX_CHAR); > -- > 2.20.1.windows.1 >=20 >=20 >=20 >=20 >=20