From patchwork Sat Sep 5 20:50:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1358189 X-Patchwork-Delegate: bmeng.cn@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=cF1rBYmX; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BkRYL0WQsz9sSJ for ; Sun, 6 Sep 2020 06:51:49 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 11CD582315; Sat, 5 Sep 2020 22:51:25 +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="cF1rBYmX"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 986818230A; Sat, 5 Sep 2020 22:51:21 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x143.google.com (mail-il1-x143.google.com [IPv6:2607:f8b0:4864:20::143]) (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 7E9A5822E3 for ; Sat, 5 Sep 2020 22:51:18 +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-x143.google.com with SMTP id u20so479625ilk.6 for ; Sat, 05 Sep 2020 13:51:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=lmD04jarOWbpb12838fUMpNlM2F4fcTv6BRAG0qA0xY=; b=cF1rBYmXpc67VHqGPcXQZJHf8jntvybIQaPRCpEy0BaorS0DJhIAxT2SQZ/FCbCSCB 9ZjSRik61ktlq0BNwhchZBTvm04808t2mFBXvLlZ5cPG4qMFw2p2VUJYONa7arZlRIBh 2tGYd/cStjLnp5ZLTISC381i5bUBrVBkjRBVk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=lmD04jarOWbpb12838fUMpNlM2F4fcTv6BRAG0qA0xY=; b=NKFeMgdyda6dzwMylKz4kznONo2AxAhrMXVCz/DrnKuxBD2f40ogR3NOvNmn4vpwRk sFtP5RuKASFmKmrpzb7P6Rxc6YlpCAlSoWjP5VWRaO1swHuVsFm+OHK8aPe1nwHLbS64 bvWOeyOZm3p0A5DxL1fimR6sSTsg+koYqLB7JQ0m3gKCGq8RSTKYnFuH/38BuZTY6eUL QH/7330Z/Tly/LhYadEtwYDhMeVCWqywzD8kMvIWf6K6M3QwDWK2AA8j4Irn1/L3UN3G dhaPgJV79WO1vScNMDybH41nRgF/1HR4edu9+YJNNLjhBl3P+Ra/E0a/1JKfoeY+UdbM 0y2g== X-Gm-Message-State: AOAM532UWsmes6zBYsNtMLgkPy15yr6XxxK/Rn59Rv095euTlDxdS4gA SOBK5vhQcjpaJ3RiF+f4V0Vc/b1kWrYN06AO X-Google-Smtp-Source: ABdhPJzLVv/J7weAzzXrCnz6kmDklvRA8dFz79fuWfO6nSIKun21ZQHgh6j3INzCCBRbKEv9fYooWg== X-Received: by 2002:a05:6e02:d4f:: with SMTP id h15mr12496369ilj.307.1599339077309; Sat, 05 Sep 2020 13:51:17 -0700 (PDT) Received: from localhost.localdomain (c-73-14-175-90.hsd1.co.comcast.net. [73.14.175.90]) by smtp.gmail.com with ESMTPSA id b14sm5625422ill.30.2020.09.05.13.51.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Sep 2020 13:51:17 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass , Wolfgang Wallner , Bin Meng Subject: [PATCH v3 03/17] x86: zimage: Avoid using #ifdef Date: Sat, 5 Sep 2020 14:50:39 -0600 Message-Id: <20200905205053.1633153-4-sjg@chromium.org> X-Mailer: git-send-email 2.28.0.526.ge36021eeef-goog In-Reply-To: <20200905205053.1633153-1-sjg@chromium.org> References: <20200905205053.1633153-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.102.3 at phobos.denx.de X-Virus-Status: Clean Use IS_ENABLED() instead of #ifdef in this file. Signed-off-by: Simon Glass Reviewed-by: Wolfgang Wallner Reviewed-by: Bin Meng --- (no changes since v1) arch/x86/lib/zimage.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/arch/x86/lib/zimage.c b/arch/x86/lib/zimage.c index a79971f052c..3c8081a48bb 100644 --- a/arch/x86/lib/zimage.c +++ b/arch/x86/lib/zimage.c @@ -303,21 +303,17 @@ int setup_zimage(struct boot_params *setup_base, char *cmd_line, int auto_boot, build_command_line(cmd_line, auto_boot); } -#ifdef CONFIG_INTEL_MID - if (bootproto >= 0x0207) + if (IS_ENABLED(CONFIG_INTEL_MID) && bootproto >= 0x0207) hdr->hardware_subarch = X86_SUBARCH_INTEL_MID; -#endif -#ifdef CONFIG_GENERATE_ACPI_TABLE - setup_base->acpi_rsdp_addr = acpi_get_rsdp_addr(); -#endif + if (IS_ENABLED(CONFIG_GENERATE_ACPI_TABLE)) + setup_base->acpi_rsdp_addr = acpi_get_rsdp_addr(); setup_device_tree(hdr, (const void *)env_get_hex("fdtaddr", 0)); setup_video(&setup_base->screen_info); -#ifdef CONFIG_EFI_STUB - setup_efi_info(&setup_base->efi_info); -#endif + if (IS_ENABLED(CONFIG_EFI_STUB)) + setup_efi_info(&setup_base->efi_info); return 0; }