Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 437B4C433F5 for ; Tue, 11 Oct 2022 15:48:25 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C88CD84F20; Tue, 11 Oct 2022 17:48:16 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="hWZ8QL2l"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 467C884F00; Tue, 11 Oct 2022 17:48:13 +0200 (CEST) Received: from mail-il1-x12e.google.com (mail-il1-x12e.google.com [IPv6:2607:f8b0:4864:20::12e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 7169084F14 for ; Tue, 11 Oct 2022 17:48:09 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x12e.google.com with SMTP id 8so7372586ilj.4 for ; Tue, 11 Oct 2022 08:48:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=qHQeAOMoWsoj8HuGM4BnuNbYplchhqCV/CoIQ9r1ZpY=; b=hWZ8QL2lolXt8zbPgCBFE2/mzsV6b+bw2OUevxTG6iyoCzKs1cG5R6BE+zF8mGXKo6 Y6tRe00eSTHX9hIUUTbMnjMIFIcHWOr8NxgSRLqGcWNCDizOvetiLAPHjf0Mr357aEMp iNrYHgmavteomI/Y6kfoPPV3XFuLWGAOQmY+c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qHQeAOMoWsoj8HuGM4BnuNbYplchhqCV/CoIQ9r1ZpY=; b=0hSmm2g1NISL2YPejXQodWrh8FBNARveOH7PwqCBCAk8cbD38TwIlz2SY4ioYuxhSt JWEbwV0UlNOibEUUIcBAPpTjQJgeieHNcI3pMddx7fLzWxqZSGeWOhwAmi/xmFI5edyJ bUoLrbfYRUlcqY595US4JyzEIJ/ORXL38AmjwMo4LQ/q4Ww1hf5uQsiVgFoQDzCLf9oH zW3r1VOgMJI4jGjyJdLAN9wBVYNLazG0v+CtUw5J0arpKRvyVVw++MS65BRrQJpZ5VE3 IM31LPQ+vOju66GU4r9xLz5l8SV9iT2ulIt/WPE0DB715dGNONZc1m6EhBXtGOYRU9LX Md2Q== X-Gm-Message-State: ACrzQf0onAQ82SlIfH1045foQRXxTqHYMBg5czdPyIITMUwwr971n0j/ o/S4t8C+sCaUFVvda4SJO2Jxexq+NyTHDQ== X-Google-Smtp-Source: AMsMyM5FqbIVdX05ZOu78uz5SNL1x9KcKQZqKIpmh9HL/nJCCcar/zyeUZqaBOcUTzaAicfcc3NAvg== X-Received: by 2002:a05:6e02:15c4:b0:2e1:986c:91a1 with SMTP id q4-20020a056e0215c400b002e1986c91a1mr12229015ilu.22.1665503287657; Tue, 11 Oct 2022 08:48:07 -0700 (PDT) Received: from sjg1.roam.corp.google.com (c-67-190-102-125.hsd1.co.comcast.net. [67.190.102.125]) by smtp.gmail.com with ESMTPSA id r12-20020a922a0c000000b002f9b55e7e92sm4988680ile.0.2022.10.11.08.48.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Oct 2022 08:48:07 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass , Patrick Delaunay , Philippe Reynes , Stefan Roese Subject: [PATCH v2 03/14] bootm: Drop #ifdef from do_bootm() Date: Tue, 11 Oct 2022 09:47:09 -0600 Message-Id: <20221011154720.550320-4-sjg@chromium.org> X-Mailer: git-send-email 2.38.0.rc1.362.ged0d419d3c-goog In-Reply-To: <20221011154720.550320-1-sjg@chromium.org> References: <20221011154720.550320-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean Drop the #ifdefs from this command by using a variable to hold the states that should be executed. Signed-off-by: Simon Glass --- (no changes since v1) cmd/bootm.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/cmd/bootm.c b/cmd/bootm.c index f09b41c2c16..37c2af96e08 100644 --- a/cmd/bootm.c +++ b/cmd/bootm.c @@ -120,6 +120,7 @@ static int do_bootm_subcommand(struct cmd_tbl *cmdtp, int flag, int argc, int do_bootm(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { + int states; int ret; #ifdef CONFIG_NEEDS_MANUAL_RELOC @@ -154,17 +155,15 @@ int do_bootm(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) return do_bootm_subcommand(cmdtp, flag, argc, argv); } - ret = do_bootm_states(cmdtp, flag, argc, argv, BOOTM_STATE_START | - BOOTM_STATE_FINDOS | BOOTM_STATE_PRE_LOAD | BOOTM_STATE_FINDOTHER | - BOOTM_STATE_LOADOS | -#ifdef CONFIG_SYS_BOOT_RAMDISK_HIGH - BOOTM_STATE_RAMDISK | -#endif -#if defined(CONFIG_PPC) || defined(CONFIG_MIPS) - BOOTM_STATE_OS_CMDLINE | -#endif + states = BOOTM_STATE_START | BOOTM_STATE_FINDOS | BOOTM_STATE_PRE_LOAD | + BOOTM_STATE_FINDOTHER | BOOTM_STATE_LOADOS | BOOTM_STATE_OS_PREP | BOOTM_STATE_OS_FAKE_GO | - BOOTM_STATE_OS_GO, &images, 1); + BOOTM_STATE_OS_GO; + if (IS_ENABLED(CONFIG_SYS_BOOT_RAMDISK_HIGH)) + states |= BOOTM_STATE_RAMDISK; + if (IS_ENABLED(CONFIG_PPC) || IS_ENABLED(CONFIG_MIPS)) + states |= BOOTM_STATE_OS_CMDLINE; + ret = do_bootm_states(cmdtp, flag, argc, argv, states, &images, 1); return ret ? CMD_RET_FAILURE : 0; } -- 2.38.0.rc1.362.ged0d419d3c-goog