From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: suse.com, ip: 15.124.64.68, mailfrom: glin@suse.com) 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 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 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 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 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 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-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) authentication-results: spf=none (sender IP is ) smtp.mailfrom=GLin@suse.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.22.0 x-originating-ip: [202.47.205.198] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 67b9ec15-5eae-4339-89d6-08d714c6322f x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328)(7193020);SRVR:DM6PR18MB3068; x-ms-traffictypediagnostic: DM6PR18MB3068: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8273; x-forefront-prvs: 0114FF88F6 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(4636009)(376002)(136003)(346002)(39860400002)(396003)(366004)(189003)(199004)(5660300002)(6436002)(76176011)(52116002)(25786009)(2351001)(3846002)(14444005)(53936002)(71200400001)(26005)(6916009)(486006)(476003)(71190400001)(446003)(11346002)(4326008)(6486002)(68736007)(8676002)(5640700003)(186003)(2616005)(2501003)(316002)(86362001)(66446008)(66066001)(478600001)(50226002)(81156014)(14454004)(1730700003)(19627235002)(256004)(6116002)(64756008)(36756003)(66556008)(81166006)(54906003)(102836004)(6512007)(66946007)(2906002)(80792005)(7736002)(99286004)(6506007)(386003)(305945005)(1076003)(8936002)(66476007);DIR:OUT;SFP:1102;SCL:1;SRVR:DM6PR18MB3068;H:DM6PR18MB2489.namprd18.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; 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 Return-Path: GLin@suse.com X-OriginatorOrg: suse.com Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable 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