From mboxrd@z Thu Jan 1 00:00:00 1970 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 C3F3EC04A95 for ; Sun, 25 Sep 2022 15:04:09 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3F48B84B6B; Sun, 25 Sep 2022 17:03: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="OxZvLCju"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2D0BF845EF; Sun, 25 Sep 2022 17:03:21 +0200 (CEST) Received: from mail-io1-xd2a.google.com (mail-io1-xd2a.google.com [IPv6:2607:f8b0:4864:20::d2a]) (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 486DC84B5D for ; Sun, 25 Sep 2022 17:03: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-io1-xd2a.google.com with SMTP id z191so3403085iof.10 for ; Sun, 25 Sep 2022 08:03:18 -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; bh=0xkxLLIweGbkiGHN+CdgJz6t5ee5ui29j/WeJlNugm8=; b=OxZvLCjuHiaA4SPZpyba5xy4GsNzIMo89NJIdNIAFWnKbZtlgjwu35MIHUI5flAvUa soSD8y/KGC+oKLaInBq+8ixvdK7TJUFGuXogLWMpjRCRyiwgxRBYoePqeyPmpbhQ3VmO rd2jXQadXbgPtD+/QTq7OlrMJvWw6MELmjDTE= 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; bh=0xkxLLIweGbkiGHN+CdgJz6t5ee5ui29j/WeJlNugm8=; b=Da+Fe7V6E5AgQBhHiKo8jUfz6gLloRutadUibcnPWfr46qc70PXozBYOvATgTME6Au 2ijw6BaYpGzh1KZi1TbipX2ePNXzpKjw0/Bke7/EtRL9cqTheJasKFgfjp/UzlKi1vfT +j/59ihSkdmYtTCXxWQs6QS0Dsn6CMUFv9gMtDiBGAE8qiYiWKJSseqe3XVSG7OwEQXx D9VlOjhj98d63A5AD+dANskmyhNgRmZPRW3jyoJRz10k7FmXoAF0mljU5sYos8f4B8U9 o+rC+Ne4NcJ0fZEmxPVIc9tC7ILhd1uq2MBn9skbvFq8K6AOdhVtlBEuq9euqxfS6dDX hVnQ== X-Gm-Message-State: ACrzQf10fZllR2WSKBXsr7XICh/K4zz5gvsnwlrxWFAR5antErzjxFoU EJlbKdpbUIR/0MBRoqrPk9UDDd326U7wUA== X-Google-Smtp-Source: AMsMyM5i1euj5Z0JjmThkwF222RksuhVp50f0VAGvPwWXxsXa41TQhPUac40U37FkyjG3a1HdRrrZw== X-Received: by 2002:a05:6638:2113:b0:35a:cafe:59be with SMTP id n19-20020a056638211300b0035acafe59bemr9821019jaj.234.1664118196433; Sun, 25 Sep 2022 08:03:16 -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 u19-20020a926013000000b002f19d9838c6sm5360578ilb.25.2022.09.25.08.03.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Sep 2022 08:03:16 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass , Alper Nebi Yasak , =?UTF-8?q?Marek=20Beh=C3=BAn?= , =?UTF-8?q?Pali=20Roh=C3=A1r?= , Stefan Roese Subject: [PATCH 07/45] spl: Refactor controls for console output Date: Sun, 25 Sep 2022 09:02:10 -0600 Message-Id: <20220925150248.2524421-8-sjg@chromium.org> X-Mailer: git-send-email 2.37.3.998.g577e59143f-goog In-Reply-To: <20220925150248.2524421-1-sjg@chromium.org> References: <20220925150248.2524421-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 The expression in boot_from_devices() is fairly long. Move it into a function with a suitable comment. Signed-off-by: Simon Glass --- common/spl/spl.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/common/spl/spl.c b/common/spl/spl.c index edf24b05162..e7f16a18228 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -659,6 +659,18 @@ static int spl_load_image(struct spl_image_info *spl_image, return ret; } +/** + * spl_show_output() - Selects whether to show info output in SPL + * + * Returns: true if info output should be shown, false if not + */ +static inline bool spl_show_output(void) +{ + return CONFIG_IS_ENABLED(SERIAL) && + CONFIG_IS_ENABLED(LIBCOMMON_SUPPORT) && + !IS_ENABLED(CONFIG_SILENT_CONSOLE); +} + /** * boot_from_devices() - Try loading a booting U-Boot from a list of devices * @@ -682,9 +694,7 @@ static int boot_from_devices(struct spl_image_info *spl_image, if (CONFIG_IS_ENABLED(SHOW_ERRORS)) ret = -ENXIO; loader = spl_ll_find_loader(bootdev); - if (CONFIG_IS_ENABLED(SERIAL) && - CONFIG_IS_ENABLED(LIBCOMMON_SUPPORT) && - !IS_ENABLED(CONFIG_SILENT_CONSOLE)) { + if (spl_show_output()) { if (loader) printf("Trying to boot from %s\n", spl_loader_name(loader)); -- 2.37.3.998.g577e59143f-goog