From nobody Wed Nov 27 00:47:15 2024 Delivered-To: importer@patchew.org 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+44596+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one) Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 156447475608255.65055237425349; Tue, 30 Jul 2019 01:19:16 -0700 (PDT) Return-Path: X-Received: from m9a0003g.houston.softwaregrp.com (m9a0003g.houston.softwaregrp.com [15.124.64.68]) by groups.io with SMTP; Tue, 30 Jul 2019 01:19:15 -0700 X-Received: FROM m9a0003g.houston.softwaregrp.com (15.121.0.191) BY m9a0003g.houston.softwaregrp.com WITH ESMTP; Tue, 30 Jul 2019 08:19:12 +0000 X-Received: from M9W0068.microfocus.com (2002:f79:bf::f79:bf) by M9W0068.microfocus.com (2002:f79:bf::f79:bf) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Tue, 30 Jul 2019 08:16:18 +0000 X-Received: from NAM03-CO1-obe.outbound.protection.outlook.com (15.124.72.14) by M9W0068.microfocus.com (15.121.0.191) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Tue, 30 Jul 2019 08:16:18 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kLVZNbXGAmjIF2UxLRAGmPhrIZCF4x/6Z1xsNC5yueWL27MW5NIfS7uncTNc7EcOp82l8GjA0Oq5QFGWfE9WR2gSYOCC+VOBS8SmpLFY4qEVr3xDUs0RWhOyWZsNi8kNLR12QdLHwRukpgQhMCpTS3HZJzDpS3biUcE+SGu/+I+BzhZwmvLQAmsgvIqabQOmMfqAjdCJ/rTtbDzLhR1T6yARCnXNFBFD8azNBhDIQqKfIF7SzxLLd5Fn1B2+s4aykUQm+hZh+h7XoAuvPFZaiRnxlC/M6Cut8Mgq2dc3CcROP3GQRwxiCbvAONWEkzWFFG6eSRzK39njblZkTQfcOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3+KtRgcmL6Ma/oz+89SFSTZdh55xlW+F9Zq8/JKaQNk=; b=QUMyl0vRWlXfFkh/2BmQ+v9bfSYbwzHeS/sD/g6huR+PrAHCgPUy/v6fHIU10CUAMB7pu3SmjpCZM76+321n83GxhmwUogBPieWRsoGxlwZRctIvnmdoa95/Nc/BTtU4HYFNcKtgcq/jPtiR3u2EjzlnUxvTqvFUa8j5X7gZ6BlaIqm7AFe8fuFOXdbLRZtBFw70mHXkkJl+azSBwN/O/1IqeKSBX6gBoGgFWys5qg7WHyDscngv+5VFj5+CErysWP1V/inOL86cstD6GVyhu6y2VOk78kp0QSzX4wv/ECQ4iU5qGFa7JxgZnrcEe3zSSETPmn6wjRorppqGFJ28BQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1;spf=pass smtp.mailfrom=suse.com;dmarc=pass action=none header.from=suse.com;dkim=pass header.d=suse.com;arc=none X-Received: from DM6PR18MB2489.namprd18.prod.outlook.com (20.179.105.16) by DM6PR18MB3068.namprd18.prod.outlook.com (20.179.48.77) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2115.14; Tue, 30 Jul 2019 08:16:17 +0000 X-Received: from DM6PR18MB2489.namprd18.prod.outlook.com ([fe80::ac83:47c9:cebd:9f0]) by DM6PR18MB2489.namprd18.prod.outlook.com ([fe80::ac83:47c9:cebd:9f0%7]) with mapi id 15.20.2115.005; Tue, 30 Jul 2019 08:16:17 +0000 From: "Gary Lin" To: "devel@edk2.groups.io" CC: Zailiang Sun , Yi Qian , Michael D Kinney Subject: [edk2-devel] [edk2-platforms] [PATCH v2 4/6] Vlv2TbltDevicePkg: Clean up the unused variables and function Thread-Topic: [edk2-platforms] [PATCH v2 4/6] Vlv2TbltDevicePkg: Clean up the unused variables and function Thread-Index: AQHVRq8Pzd3ACXfNuUC2ygId5x0nmw== Date: Tue, 30 Jul 2019 08:16:17 +0000 Message-ID: <20190730081518.16349-5-glin@suse.com> References: <20190730081518.16349-1-glin@suse.com> In-Reply-To: <20190730081518.16349-1-glin@suse.com> Accept-Language: zh-TW, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: DB6PR1001CA0031.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:4:55::17) To DM6PR18MB2489.namprd18.prod.outlook.com (2603:10b6:5:184::16) x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [202.47.205.198] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 67b9ec15-5eae-4339-89d6-08d714c6322f x-ms-traffictypediagnostic: DM6PR18MB3068: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8273; 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+44596+1787277+3901457@groups.io; helo=web01.groups.io; received-spf: None (protection.outlook.com: suse.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: 653vgoxY/LVpAJ7dm8bpX7qPuWvx2A37sFzr21+0rUGDegohGbrihFIPP6cisCPFG6oMXjVUuRKh58hbZpHXfJL4k/6xiUnn4uIE4Xu4G/Vo15MEQpqIMc0ZHh/Udu/etZSsMdvXd3GfoZaWzcPvkV606d4427PS0LnmGd7o5uG2V4EgOsXRBDTwwAE7t33Lkf3csKu3nbtz2aDxCJxrNWJ6W1hRZtuf0ZOj43GSHOhGBTBT3RSY6leIDiFUIUl+geWGoqFfM8uSAEhdB/wJA7CcfLnCc8Snh9lhOPRUlKnlfW97GlJySVIrJzN50i+7hJ0dCLfuMr4PsY5TQ5KV4bFpL0EJWzDTYCKwPUIgWSugpC5iqrdkDpSQf0ZA0WFMiiHaFS1bKMPEmzBQYd/m93tkkRLhbfwkzHS0l2QuTe4= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 67b9ec15-5eae-4339-89d6-08d714c6322f X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Jul 2019 08:16:17.7908 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: GLin@suse.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR18MB3068 X-OriginatorOrg: suse.com 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,glin@suse.com Content-Language: en-US Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1564474755; bh=d1MOlxUlo6kXTYFPND2FRR7+ta3Gxgn6j8WG2BRgxrk=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=ZQB4fdJ8VXoMID11iiGjOiJqM9gPJappztfYLqMLX/bmRbS4qsTSt+sH1N+nvz6Jpdt ofkDagKxUXT+PE8We3InM7oJdabkeBKSCIGmLO2OTfWnvMeUpt0tlguW5K/LUnJP0Kl0k sRFK2dG6F7c04wCXPZhbIxaE92pzf8QrS2k= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" In PlatformBootOption.c: * mContinueBoot and mBootMenuBoot were assigned as "!EnterSetup" before being used. However, EnterSetup is always "FALSE", so it's meaningless to keep those variables. * mPxeBoot is defined but never used. * DetectKeypressCallback() is never used. So we can remove it altogether with mHotKeypressed and HotKeyEvent. * RegisterBootOptionHotkey() only uses EFI_INPUT_KEY from EFI_KEY_DATA, so we don't need to use EFI_KEY_DATA for F2 and F7 in RegisterStaticHotkey(). v2: Update the description for the removal of EFI_KEY_DATA Cc: Zailiang Sun Cc: Yi Qian Cc: Michael D Kinney Signed-off-by: Gary Lin --- Platform/Intel/Vlv2TbltDevicePkg/Library/DxePlatformBootManagerLib/Platfor= mBootOption.c | 57 ++++---------------- 1 file changed, 11 insertions(+), 46 deletions(-) diff --git a/Platform/Intel/Vlv2TbltDevicePkg/Library/DxePlatformBootManage= rLib/PlatformBootOption.c b/Platform/Intel/Vlv2TbltDevicePkg/Library/DxePla= tformBootManagerLib/PlatformBootOption.c index 195b3f3097..7b0c2ea336 100644 --- a/Platform/Intel/Vlv2TbltDevicePkg/Library/DxePlatformBootManagerLib/Pl= atformBootOption.c +++ b/Platform/Intel/Vlv2TbltDevicePkg/Library/DxePlatformBootManagerLib/Pl= atformBootOption.c @@ -10,12 +10,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent =20 #include =20 -BOOLEAN mContinueBoot =3D FALSE; -BOOLEAN mBootMenuBoot =3D FALSE; -BOOLEAN mPxeBoot =3D FALSE; -BOOLEAN mHotKeypressed =3D FALSE; -EFI_EVENT HotKeyEvent =3D NULL; - UINTN mBootMenuOptionNumber; =20 EFI_DEVICE_PATH_PROTOCOL * @@ -396,21 +390,6 @@ RegisterBootOptionHotkey ( } } =20 -EFI_STATUS -EFIAPI -DetectKeypressCallback ( - IN EFI_KEY_DATA *KeyData -) -{ - mHotKeypressed =3D TRUE; - - if (HotKeyEvent !=3D NULL) { - gBS->SignalEvent(HotKeyEvent); - } - - return EFI_SUCCESS; -} - /** This function is called after all the boot options are enumerated and or= dered properly. **/ @@ -419,46 +398,32 @@ RegisterStaticHotkey ( VOID ) { - EFI_INPUT_KEY Enter; - EFI_KEY_DATA F2; - EFI_KEY_DATA F7; - BOOLEAN EnterSetup; + EFI_INPUT_KEY F2; + EFI_INPUT_KEY F7; EFI_STATUS Status; EFI_BOOT_MANAGER_LOAD_OPTION BootOption; =20 - EnterSetup =3D FALSE; - // // [Enter] // - mContinueBoot =3D !EnterSetup; - if (mContinueBoot) { - Enter.ScanCode =3D SCAN_NULL; - Enter.UnicodeChar =3D CHAR_CARRIAGE_RETURN; - EfiBootManagerRegisterContinueKeyOption (0, &Enter, NULL); - } - + Enter.ScanCode =3D SCAN_NULL; + Enter.UnicodeChar =3D CHAR_CARRIAGE_RETURN; + EfiBootManagerRegisterContinueKeyOption (0, &Enter, NULL); =20 // // [F2]/[F7] // - F2.Key.ScanCode =3D SCAN_F2; - F2.Key.UnicodeChar =3D CHAR_NULL; - F2.KeyState.KeyShiftState =3D EFI_SHIFT_STATE_VALID; - F2.KeyState.KeyToggleState =3D 0; + F2.ScanCode =3D SCAN_F2; + F2.UnicodeChar =3D CHAR_NULL; Status =3D EfiBootManagerGetBootManagerMenu (&BootOption); ASSERT_EFI_ERROR (Status); - RegisterBootOptionHotkey ((UINT16) BootOption.OptionNumber, &F2.Key, TRU= E); + RegisterBootOptionHotkey ((UINT16) BootOption.OptionNumber, &F2, TRUE); EfiBootManagerFreeLoadOption (&BootOption); =20 - F7.Key.ScanCode =3D SCAN_F7; - F7.Key.UnicodeChar =3D CHAR_NULL; - F7.KeyState.KeyShiftState =3D EFI_SHIFT_STATE_VALID; - F7.KeyState.KeyToggleState =3D 0; - mBootMenuBoot =3D !EnterSetup; - RegisterBootOptionHotkey ((UINT16) mBootMenuOptionNumber, &F7.Key, mBoot= MenuBoot); - + F7.ScanCode =3D SCAN_F7; + F7.UnicodeChar =3D CHAR_NULL; + RegisterBootOptionHotkey ((UINT16) mBootMenuOptionNumber, &F7, TRUE); } =20 UINT8 --=20 2.22.0 -=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 (#44596): https://edk2.groups.io/g/devel/message/44596 Mute This Topic: https://groups.io/mt/32651920/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-