From patchwork Sat Oct 3 17:31:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1376340 X-Patchwork-Delegate: sjg@chromium.org 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=KNOMDBxI; 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 4C3YsS3Gdgz9sSC for ; Sun, 4 Oct 2020 04:35:08 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9E3888242A; Sat, 3 Oct 2020 19:32:30 +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="KNOMDBxI"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 26495823DD; Sat, 3 Oct 2020 19:32:25 +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-x144.google.com (mail-il1-x144.google.com [IPv6:2607:f8b0:4864:20::144]) (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 87B3A823DD for ; Sat, 3 Oct 2020 19:32:22 +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-x144.google.com with SMTP id j13so4135379ilc.4 for ; Sat, 03 Oct 2020 10:32:22 -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=R0/vCAIGLhXe0jOpZODNiROtips+50ylMFL0MpHsxBY=; b=KNOMDBxIaKo6dmI5V1ZqOzdE45JB39Dupe8h7Cqo2TU392ROFGeRyWM33ECuQIhXmC iOunVdwAjk5Nvgr33YBFNwesphrYs6IH0olZpx2iq1OW8pH8v2tzL0CZWfjqO1JbSuuz U6b4/1uyaZlPaFjiRiaksHu52v50nKDNI2eOo= 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=R0/vCAIGLhXe0jOpZODNiROtips+50ylMFL0MpHsxBY=; b=Gev9NB9TZ77QMGeaGniFKPAA9m+Sw5TLOe/1KkaCuqzxY1fAu5BvzpF4roaL/UKzaM In5mcLwiIY0ScE5uiwia2hqQGQcpYF0FA/x3xOwVz+BJktjyEZG//c3WEXLMl0pV5FyU 0o+vV/sXDqkt9BWknVJKlqr9O3I2kfsc5+GD3CRfseQCy+4Tqbvr0StzKiH/aShE78XZ IoSgvwTkmehUFy3fHrMv8l3oylYX1L5xqf8SJPWgAFHkcSw309CvMYETQ8zSy98lOuc7 HQWcZPcG2BM1m7hZ0YyFFsWcBIUc5/HIn81Pxg1MZ3MIq3SInshOf/3TlpP2AsPNwtIJ 7Cxg== X-Gm-Message-State: AOAM530qmQsEgzOm423XO5FOxP/l/L4ZwkYm7ppUcsWODlckHc9KGpJv kREKr9dR654ekOa61F7NGUlTDxWkMaSTx31n X-Google-Smtp-Source: ABdhPJx4xKI9XU2yozBezTHbBil9oLkT6dS2uDffaGe/5J1SB3+yXlrwQh8wuBdK5CtvZaFTvp9L5Q== X-Received: by 2002:a92:9859:: with SMTP id l86mr6467289ili.167.1601746341346; Sat, 03 Oct 2020 10:32:21 -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 t14sm2930963ilj.45.2020.10.03.10.32.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 03 Oct 2020 10:32:20 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Walter Lozano , Tom Rini , Simon Glass , Marek Vasut , Pavel Herrmann Subject: [PATCH 15/20] dm: core: Convert #ifdef to if() in root.c Date: Sat, 3 Oct 2020 11:31:37 -0600 Message-Id: <20201003173142.3213123-16-sjg@chromium.org> X-Mailer: git-send-email 2.28.0.806.g8561365e88-goog In-Reply-To: <20201003173142.3213123-1-sjg@chromium.org> References: <20201003173142.3213123-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 Convert a few conditions to use compile-time checks to reduce the number of build paths. Signed-off-by: Simon Glass Signed-off-by: Simon Glass --- drivers/core/root.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/drivers/core/root.c b/drivers/core/root.c index e8df5aebe84..5f10d7a39c7 100644 --- a/drivers/core/root.c +++ b/drivers/core/root.c @@ -50,7 +50,6 @@ void dm_fixup_for_gd_move(struct global_data *new_gd) } } -#if defined(CONFIG_NEEDS_MANUAL_RELOC) void fix_drivers(void) { struct driver *drv = @@ -129,8 +128,6 @@ void fix_devices(void) } } -#endif - int dm_init(bool of_live) { int ret; @@ -141,11 +138,11 @@ int dm_init(bool of_live) } INIT_LIST_HEAD(&DM_UCLASS_ROOT_NON_CONST); -#if defined(CONFIG_NEEDS_MANUAL_RELOC) - fix_drivers(); - fix_uclass(); - fix_devices(); -#endif + if (IS_ENABLED(CONFIG_NEEDS_MANUAL_RELOC)) { + fix_drivers(); + fix_uclass(); + fix_devices(); + } ret = device_bind_by_name(NULL, false, &root_info, &DM_ROOT_NON_CONST); if (ret) @@ -350,9 +347,8 @@ int dm_init_and_scan(bool pre_reloc_only) { int ret; -#if CONFIG_IS_ENABLED(OF_PLATDATA) - dm_populate_phandle_data(); -#endif + if (CONFIG_IS_ENABLED(OF_PLATDATA)) + dm_populate_phandle_data(); ret = dm_init(CONFIG_IS_ENABLED(OF_LIVE)); if (ret) {