From nobody Mon Feb 9 07:55:43 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+47394+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+47394+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1568749801; cv=none; d=zoho.com; s=zohoarc; b=eNWOhheD4RMvLgWC76I4iR+8Sme48xYEXH7KbwHrk0SzSQayYCgUaVtaNPVFabf7JKutjt8+9TbkDYaSz4BJ6e0QCKazenOdk2GxZHiKU2I22YQi18tc7VOCe1GCL7EEt7KkT2XJj8FV4nIqyh7HJdRZdaUmOO9MZVWUW60IGO0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568749801; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To:ARC-Authentication-Results; bh=vTFjtlkNexHvU9TLluC+g2Nm4hW2dfkapKY48Wm3Dvo=; b=mwiizxThriM5foBjf0mbL/N9+6ZL/9WyGX+TkFggC1w571cfBx4uybnvedFqICPBT7ZhtQSjAH0M8Tx9a5Wzs+2MTJoe4I1hPbbdJW+VFyU6bnA4ERUmfkMdxyL2gft9DjmWVWYb4cgdbhNxdItXcMPwKVYeGTAAm+JnpGTXh2g= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+47394+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1568749801603391.12186822575745; Tue, 17 Sep 2019 12:50:01 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id RoEgYY1788612xY0Aw3DJetn; Tue, 17 Sep 2019 12:50:01 -0700 X-Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by groups.io with SMTP; Tue, 17 Sep 2019 12:50:00 -0700 X-Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 168343086211; Tue, 17 Sep 2019 19:50:00 +0000 (UTC) X-Received: from lacos-laptop-7.usersys.redhat.com (ovpn-120-37.rdu2.redhat.com [10.10.120.37]) by smtp.corp.redhat.com (Postfix) with ESMTP id 38210600C4; Tue, 17 Sep 2019 19:49:58 +0000 (UTC) From: "Laszlo Ersek" To: edk2-devel-groups-io Cc: Dandan Bi , Eric Dong , Hao A Wu , Jian J Wang , Liming Gao , Ray Ni Subject: [edk2-devel] [PATCH 07/35] MdeModulePkg: fix cast in GetModuleInfoFromHandle() calls Date: Tue, 17 Sep 2019 21:49:07 +0200 Message-Id: <20190917194935.24322-8-lersek@redhat.com> In-Reply-To: <20190917194935.24322-1-lersek@redhat.com> References: <20190917194935.24322-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Tue, 17 Sep 2019 19:50:00 +0000 (UTC) Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,lersek@redhat.com X-Gm-Message-State: HeomWiA7ekMnlExsibCYmP1Ux1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1568749801; bh=gwuL8EC420MCtkYt49CyOly6FyTljiKlZo6NZYBlYZY=; h=Cc:Date:From:Reply-To:Subject:To; b=h2L/qCyuQQXoXNX5w854vMs9mgKENZI5prwrxUQm3XFHQijeVxmNZGHwISW0qRktJlV s35zvyx40hjX2gbEjFFXE4NW2UhBPk7+W6gm+usIN0Yuylb+i4tvkArH8wGsTBp2xHvKo 0S6Kg7qRYQWfsz4cjonUqAkcaK8975ovyRE= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" GetModuleInfoFromHandle() takes an EFI_HANDLE -- (VOID*) -- as first parameter, but InsertFpdtRecord() passes (EFI_HANDLE*) -- (VOID**). (VOID**) converts silently to (VOID*), which is why the wrong cast is masked. Note that the *value* that is passed is alright -- therefore this patch does not change behavior --, it's just semantically wrong to pass an (EFI_HANDLE*) where an EFI_HANDLE is expected. Cc: Dandan Bi Cc: Eric Dong Cc: Hao A Wu Cc: Jian J Wang Cc: Liming Gao Cc: Ray Ni Signed-off-by: Laszlo Ersek Reviewed-by: Dandan Bi Reviewed-by: Philippe Mathieu-Daude --- Notes: lightly tested, as DxeCorePerformanceLib is linked into ArmVirtQemu's DxeCore MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c | 12 ++= ++++------ MdeModulePkg/Library/SmmCorePerformanceLib/SmmCorePerformanceLib.c | 8 ++= ++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceL= ib.c b/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c index 0d507c445210..f500e20b320b 100644 --- a/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c +++ b/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c @@ -998,7 +998,7 @@ InsertFpdtRecord ( switch (PerfId) { case MODULE_START_ID: case MODULE_END_ID: - GetModuleInfoFromHandle ((EFI_HANDLE *)CallerIdentifier, ModuleName, s= izeof (ModuleName), &ModuleGuid); + GetModuleInfoFromHandle ((EFI_HANDLE)CallerIdentifier, ModuleName, siz= eof (ModuleName), &ModuleGuid); StringPtr =3D ModuleName; // // Cache the offset of start image start record and use to update the = start image end record if needed. @@ -1031,7 +1031,7 @@ InsertFpdtRecord ( =20 case MODULE_LOADIMAGE_START_ID: case MODULE_LOADIMAGE_END_ID: - GetModuleInfoFromHandle ((EFI_HANDLE *)CallerIdentifier, ModuleName, s= izeof (ModuleName), &ModuleGuid); + GetModuleInfoFromHandle ((EFI_HANDLE)CallerIdentifier, ModuleName, siz= eof (ModuleName), &ModuleGuid); StringPtr =3D ModuleName; if (PerfId =3D=3D MODULE_LOADIMAGE_START_ID) { mLoadImageCount ++; @@ -1071,7 +1071,7 @@ InsertFpdtRecord ( case MODULE_DB_SUPPORT_END_ID: case MODULE_DB_STOP_START_ID: case MODULE_DB_STOP_END_ID: - GetModuleInfoFromHandle ((EFI_HANDLE *)CallerIdentifier, ModuleName, s= izeof (ModuleName), &ModuleGuid); + GetModuleInfoFromHandle ((EFI_HANDLE)CallerIdentifier, ModuleName, siz= eof (ModuleName), &ModuleGuid); StringPtr =3D ModuleName; if (!PcdGetBool (PcdEdkiiFpdtStringRecordEnableOnly)) { FpdtRecordPtr.GuidQwordEvent->Header.Type =3D FPDT_GUID_QW= ORD_EVENT_TYPE; @@ -1085,7 +1085,7 @@ InsertFpdtRecord ( break; =20 case MODULE_DB_END_ID: - GetModuleInfoFromHandle ((EFI_HANDLE *)CallerIdentifier, ModuleName, s= izeof (ModuleName), &ModuleGuid); + GetModuleInfoFromHandle ((EFI_HANDLE)CallerIdentifier, ModuleName, siz= eof (ModuleName), &ModuleGuid); StringPtr =3D ModuleName; if (!PcdGetBool (PcdEdkiiFpdtStringRecordEnableOnly)) { FpdtRecordPtr.GuidQwordStringEvent->Header.Type =3D FPDT_GUID_QW= ORD_STRING_EVENT_TYPE; @@ -1131,7 +1131,7 @@ InsertFpdtRecord ( case PERF_INMODULE_END_ID: case PERF_CROSSMODULE_START_ID: case PERF_CROSSMODULE_END_ID: - GetModuleInfoFromHandle ((EFI_HANDLE *)CallerIdentifier, ModuleName, s= izeof (ModuleName), &ModuleGuid); + GetModuleInfoFromHandle ((EFI_HANDLE)CallerIdentifier, ModuleName, siz= eof (ModuleName), &ModuleGuid); if (String !=3D NULL) { StringPtr =3D String; } else { @@ -1153,7 +1153,7 @@ InsertFpdtRecord ( =20 default: if (Attribute !=3D PerfEntry) { - GetModuleInfoFromHandle ((EFI_HANDLE *)CallerIdentifier, ModuleName,= sizeof (ModuleName), &ModuleGuid); + GetModuleInfoFromHandle ((EFI_HANDLE)CallerIdentifier, ModuleName, s= izeof (ModuleName), &ModuleGuid); if (String !=3D NULL) { StringPtr =3D String; } else { diff --git a/MdeModulePkg/Library/SmmCorePerformanceLib/SmmCorePerformanceL= ib.c b/MdeModulePkg/Library/SmmCorePerformanceLib/SmmCorePerformanceLib.c index 5f07464c4ec7..b4f22c14ae73 100644 --- a/MdeModulePkg/Library/SmmCorePerformanceLib/SmmCorePerformanceLib.c +++ b/MdeModulePkg/Library/SmmCorePerformanceLib/SmmCorePerformanceLib.c @@ -587,7 +587,7 @@ InsertFpdtRecord ( switch (PerfId) { case MODULE_START_ID: case MODULE_END_ID: - GetModuleInfoFromHandle ((EFI_HANDLE *)CallerIdentifier, ModuleName, s= izeof (ModuleName), &ModuleGuid); + GetModuleInfoFromHandle ((EFI_HANDLE)CallerIdentifier, ModuleName, siz= eof (ModuleName), &ModuleGuid); StringPtr =3D ModuleName; // // Cache the offset of start image start record and use to update the = start image end record if needed. @@ -612,7 +612,7 @@ InsertFpdtRecord ( =20 case MODULE_LOADIMAGE_START_ID: case MODULE_LOADIMAGE_END_ID: - GetModuleInfoFromHandle ((EFI_HANDLE *)CallerIdentifier, ModuleName, s= izeof (ModuleName), &ModuleGuid); + GetModuleInfoFromHandle ((EFI_HANDLE)CallerIdentifier, ModuleName, siz= eof (ModuleName), &ModuleGuid); StringPtr =3D ModuleName; if (PerfId =3D=3D MODULE_LOADIMAGE_START_ID) { mLoadImageCount++; @@ -669,7 +669,7 @@ InsertFpdtRecord ( case PERF_INMODULE_END_ID: case PERF_CROSSMODULE_START_ID: case PERF_CROSSMODULE_END_ID: - GetModuleInfoFromHandle ((EFI_HANDLE *)CallerIdentifier, ModuleName, s= izeof (ModuleName), &ModuleGuid); + GetModuleInfoFromHandle ((EFI_HANDLE)CallerIdentifier, ModuleName, siz= eof (ModuleName), &ModuleGuid); if (String !=3D NULL) { StringPtr =3D String; } else { @@ -691,7 +691,7 @@ InsertFpdtRecord ( =20 default: if (Attribute !=3D PerfEntry) { - GetModuleInfoFromHandle ((EFI_HANDLE *)CallerIdentifier, ModuleName,= sizeof (ModuleName), &ModuleGuid); + GetModuleInfoFromHandle ((EFI_HANDLE)CallerIdentifier, ModuleName, s= izeof (ModuleName), &ModuleGuid); if (String !=3D NULL) { StringPtr =3D String; } else { --=20 2.19.1.3.g30247aa5d201 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#47394): https://edk2.groups.io/g/devel/message/47394 Mute This Topic: https://groups.io/mt/34180207/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-