From patchwork Tue Jan 30 20:08:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heinrich Schuchardt X-Patchwork-Id: 867652 X-Patchwork-Delegate: agraf@suse.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3zWHWB6KQLz9sNc for ; Wed, 31 Jan 2018 07:08:21 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 12098C21E31; Tue, 30 Jan 2018 20:08:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 40C86C21C2F; Tue, 30 Jan 2018 20:08:13 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 5A533C21C2F; Tue, 30 Jan 2018 20:08:11 +0000 (UTC) Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) by lists.denx.de (Postfix) with ESMTPS id E4CEBC21C29 for ; Tue, 30 Jan 2018 20:08:10 +0000 (UTC) Received: from LT01.fritz.box ([95.222.46.37]) by mail.gmx.com (mrgmx001 [212.227.17.184]) with ESMTPSA (Nemesis) id 0LuOYx-1erAtR0ecJ-011k0D; Tue, 30 Jan 2018 21:08:10 +0100 From: Heinrich Schuchardt To: Alexander Graf Date: Tue, 30 Jan 2018 21:08:00 +0100 Message-Id: <20180130200800.24818-1-xypron.glpk@gmx.de> X-Mailer: git-send-email 2.11.0 X-Provags-ID: V03:K0:6hz66wrSAnTzYLzXySYzlRGNoFzvtCDykzqq+nPemQspDc/LhOe qe3mOQ4HEEi2ht2uJbRO4nnR9RY02C6j39lFbOvNUnafaGBAEKJCWDOoDFMPruFMPvfWNhg I6M7Y3MZiyjoQARJyOTSlDlklNN/yYIEMwX96Z1++CXYS3RZ2m3Qv1O/MXXlQLMKgh49Sn1 4k4XMS24O96kYx+szVdPw== X-UI-Out-Filterresults: notjunk:1; V01:K0:Rv+QtfsFRO8=:LEUW1KMCh0LwOXvCkI9g0d J7umobbY4cO7G8NRRAr7t67e3hWZO887wxD96IDVedy7RznA0E44PigeUujsWU7sJTKRA6JAi JyDcmkWHAklWY75L/AWKrgpsIxFNS+PEG6CUZC8io1dgVgog8S+5E7Pey2LfB5BcucVvPZ9nx 4IkyN4c1wfjc8ZK9hEc+J81O2z1wC5XjgQ9EKj5bX53QV+bg39WCpTii70Mw2IiT5o/wtEh3X YhGH/j3xXjif/SSvc5+p6qDXhyM4MbPa4pZIoJ+dRxh1LndCszz+9RHLdRoTSA+NJmQB5Jtka lNQ+718OBVw3nCO/O/rwVxE0B/9Q7dRJzfW9eHZtq/vZo8fXDgjYTTjqx12ZsHCcvz6LDsSys 9pXj0L8vvoHOYr2InVQkvhhILCNFLjWzutFbxykkX9/du/cr6DhCMdwg7UfD/0X0Ay9+CkqBS bQQAExutU75irr63qhbd9b95L/hrl6kaxHvfyxyTBn2yaFK8GUVAjMKe1Cm6TdZbx9Mux6P4U x/XC38jagRzJnMC76DPBtpNoyQWSMc6ykCokkyP5g4uGkDKAHgmvgZdoSUorE0CgAWi35Mdec IiOQURuvh0Oz4T870GoEv/bEUuUxfDZxltAglBcJkD/F2Smubj8y+PTq/TT3j6nOr59KGBv5+ C67Bs8m93wAaXzIIWSU4tTIcP6DRGtfZSe3neR40GmcDMLBiisnLCwWNTQOrvRWUPPM9TrwE4 50+KxnRi9fBwTY+QwpkcdJ8QKfUkvLXYguwGR6tED6UBqjIt+K7De5+7Wa/D73CbS/b/cyzQW jGkkmku4QcEwXAXjMbVxP11/1a7NQ== Cc: u-boot@lists.denx.de, Heinrich Schuchardt Subject: [U-Boot] [PATCH 1/1] efi_loader: use constants in efi_allocate_pages() X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Using the existing predefined constants is less error prone and makes the code easier to read. Signed-off-by: Heinrich Schuchardt --- lib/efi_loader/efi_memory.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/efi_loader/efi_memory.c b/lib/efi_loader/efi_memory.c index bee0a0c97d..e967e190c8 100644 --- a/lib/efi_loader/efi_memory.c +++ b/lib/efi_loader/efi_memory.c @@ -295,7 +295,7 @@ efi_status_t efi_allocate_pages(int type, int memory_type, uint64_t addr; switch (type) { - case 0: + case EFI_ALLOCATE_ANY_PAGES: /* Any page */ addr = efi_find_free_memory(len, gd->start_addr_sp); if (!addr) { @@ -303,7 +303,7 @@ efi_status_t efi_allocate_pages(int type, int memory_type, break; } break; - case 1: + case EFI_ALLOCATE_MAX_ADDRESS: /* Max address */ addr = efi_find_free_memory(len, *memory); if (!addr) { @@ -311,7 +311,7 @@ efi_status_t efi_allocate_pages(int type, int memory_type, break; } break; - case 2: + case EFI_ALLOCATE_ADDRESS: /* Exact address, reserve it. The addr is already in *memory. */ addr = *memory; break;