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 A7584C433F5 for ; Sun, 27 Mar 2022 20:27:22 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1219F839A8; Sun, 27 Mar 2022 22:27:12 +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="STHqI2w/"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8B93D836A9; Sun, 27 Mar 2022 22:26:57 +0200 (CEST) Received: from mail-pf1-x42c.google.com (mail-pf1-x42c.google.com [IPv6:2607:f8b0:4864:20::42c]) (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 0E95E8395A for ; Sun, 27 Mar 2022 22:26:52 +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-pf1-x42c.google.com with SMTP id h19so9810196pfv.1 for ; Sun, 27 Mar 2022 13:26:51 -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=mb22H+rGrw6rva4zMbvPK77WheLgz1993Hwr/ZW1UHk=; b=STHqI2w/WZDUVoj12KxtwBF2Jrb5Cb9z9BrycK7UxXt+cG4SyPY4lrTzX7tjEtUGk0 FtKR082+LY177LqG8O+QTKGESPyhxGnhcM8t/gObxqBCV0LpbUOGpYrPY82ck9v2wwE0 49aC10KjBdwLM2cy6kyz0KUQP/t90KBgkbZ+s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=mb22H+rGrw6rva4zMbvPK77WheLgz1993Hwr/ZW1UHk=; b=vr3tg5C5LL9fmsvtDKHEycj1KPSPtDUr3Qk9UEwyN92f+XkrY52ahDRhGiWftLE6b7 w48dP2vwLcBVvtKhxXBc29CqVS1zTDBswbjLy8iWhUVyOlEXVkepn1ySFTE4vzFXJc5t hHTKwpym2mS+8OW41pCYc67F7hPG80jy4bjcsipfLSvR1yF9u1ay2LBFqpiQ2eEKzNq2 jlMh8RV+LwIMKkgeb7ZP49jE+oWmMJAo69i0j2uxciqPVMuvmOEYaRNRykGcT28vC5Dv jW5D2CB/y32F5U4i0YyVLoWMIn9v1XlMJvTOierzZsjBcmSjGj7ydbGTtblQF+iamvcr PvFg== X-Gm-Message-State: AOAM530y/CRUPMGWDGQOMAbYt1NmneScia+Br2sRV4PHP4es4YW5JB69 a37CIsbkc6ggXONb3pObmReKhBYxBQfxSg== X-Google-Smtp-Source: ABdhPJxWsq2Kzs53EA9OW2MhCygWD6qI3Oed46n9yH9oDpkgSnrUJfUZ/Bn3w6zah3IFAtmDVtCp0g== X-Received: by 2002:a63:5744:0:b0:385:fe08:e835 with SMTP id h4-20020a635744000000b00385fe08e835mr7584772pgm.397.1648412810379; Sun, 27 Mar 2022 13:26:50 -0700 (PDT) Received: from localhost.localdomain (118-93-105-181.dsl.dyn.ihug.co.nz. [118.93.105.181]) by smtp.gmail.com with ESMTPSA id k3-20020a056a00168300b004f7e60da26csm13915466pfc.182.2022.03.27.13.26.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 27 Mar 2022 13:26:50 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Heinrich Schuchardt , Sean Anderson , =?UTF-8?q?Marek=20Beh=C3=BAn?= , U-Boot Custodians , Tom Rini , Simon Glass Subject: [PATCH 02/10] sandbox: Correct loss of early output in SPL Date: Sun, 27 Mar 2022 14:26:14 -0600 Message-Id: <20220327142415.2.If1c273ffb4d69da0ebb02720f7ff997e8b35944c@changeid> X-Mailer: git-send-email 2.35.1.1021.g381101b075-goog In-Reply-To: <20220327202622.3438333-1-sjg@chromium.org> References: <20220327202622.3438333-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.5 at phobos.denx.de X-Virus-Status: Clean At present fputc() is used before the console is available, then write() is used. These are not compatible. Since fputc() buffers internally it is better to use the write(), so that a partial line is immediately displayed. This has a slight effect on performance, but we are already using write() for the vast majority of the output with no obvious impacts. Signed-off-by: Simon Glass --- arch/sandbox/cpu/os.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/sandbox/cpu/os.c b/arch/sandbox/cpu/os.c index d83c862182d..5ea54179176 100644 --- a/arch/sandbox/cpu/os.c +++ b/arch/sandbox/cpu/os.c @@ -644,7 +644,7 @@ int os_get_filesize(const char *fname, long long *size) void os_putc(int ch) { - fputc(ch, stdout); + os_write(1, &ch, 1); } void os_puts(const char *str) -- 2.35.1.1021.g381101b075-goog