From patchwork Mon Jul 30 16:19:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 143149 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp4267100ljj; Mon, 30 Jul 2018 09:20:52 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeuXBE0EGzKUgDkxQg4djd76rfglNXE7yIjdeHKwmkQz8n3QdCxTUkX5RumrloPRU5qWVf+ X-Received: by 2002:a50:9069:: with SMTP id z38-v6mr9066205edz.79.1532967652412; Mon, 30 Jul 2018 09:20:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532967652; cv=none; d=google.com; s=arc-20160816; b=PDT9YjEyIWFakWxR2MMlTLLSEJ/9JaiSIc1cuWKLjvdOTn8Rdy1v0+YN045PC5wdUa l1pCW782gn6Qbg/uik3P+vrJD5CogE7NshiPwZ/LPxZg+cl+Se7YC+Tg2tVvKR+Q+8Q1 AgKUk3tDAZU0P3iEhlEUAcxHTN5VTIzuB4QiIqCLB6njsLpk2mDx+muH5HmIWD+LpRAc 7pUNXagU8KVHHgC8qeyCab+uAiINh3DZimLxYcSqIBwz3V76KvyNv27HU0rq2cqLDHhu rVPsQa7XN7QURjfReGWpe7oxyAS9YwXVYuqaWo+NKN07EJMlX0K1qjsvTeI5ilGFocNY sJRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:references:in-reply-to:message-id :date:to:from:dkim-signature:arc-authentication-results; bh=N9Ne2omYWO6ebGCYqXjV8arPXKFnpVKIdSLqYplANLA=; b=0isxYvFDTUGDrMZHBvGccET8/q0mUX4G73YuvvtHYHT5WTwP8raPhfhvvj+96Tb6hU FP+TzXfCcJgy38jEUnwlct2Gt/q+nByy3dAuZvSmEKE2Cq/UZ63a4vYdyqMbwzFtEBFy S5EXPrZ0LZqeEJWtKigWCUFRp3wQJfOC/39915yoYtd3x+ckeaAIOKfpAtvNx6+SeIrP V42e5683tFFJL5hORcXiJCuqbSg+f36ZviJwca7Pf0aeUqSpnlLrRSOxymZJSvuztfJJ JSLfbOpsyBppfhKxBVBr/HqQLvMEsSbNbyy1vQLppPDTEgJYvytkLeK7zw/SG/PmutSv yLOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=iuOd9TKf; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id u43-v6si3180687edm.452.2018.07.30.09.20.51; Mon, 30 Jul 2018 09:20:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=iuOd9TKf; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.denx.de (Postfix, from userid 105) id CC497C22085; Mon, 30 Jul 2018 16:19:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 3EF9DC22050; Mon, 30 Jul 2018 16:19:34 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 34160C21F9C; Mon, 30 Jul 2018 16:19:32 +0000 (UTC) Received: from mail-lj1-f194.google.com (mail-lj1-f194.google.com [209.85.208.194]) by lists.denx.de (Postfix) with ESMTPS id 6D9D7C21F9C for ; Mon, 30 Jul 2018 16:19:31 +0000 (UTC) Received: by mail-lj1-f194.google.com with SMTP id v9-v6so11022492ljk.4 for ; Mon, 30 Jul 2018 09:19:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=+r2BwoEt4Q8B7gtd3FWNzVfuD2L/J23lnlOaTEcmmUw=; b=iuOd9TKfkqvSwBfcJHuJGLFV81JBaPtYbI/ulb3FbUDJUUaMW7eRC51EQasNb2Q99x NOFRqy7KZuUNa2ux2royw5wHOjPKHPfMq6RhaEgrshxi/QRzST9m0/6nHbFS8yG4f+YK UoWOYGV8L6uzch+l2Yglxl2un9QvJPJPOx5go= 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; bh=+r2BwoEt4Q8B7gtd3FWNzVfuD2L/J23lnlOaTEcmmUw=; b=hY4/tCZmgM9RMvQIPqEFWO4giriYgejPUBCneX9pgw3VbzHQuMByvmer8EwzbvRPpw uIGL8jN1Ht1Vrx9RnmopvvzkqKEBmNCDPnI+kJNOP72+0V1h1aq9kURJv22Zx6qQedMh zE7Wisa/FwISIpo8Q3ZOYKi/A3lPOmUG6MT9H65uR6MdsMhBECOzyRdHbVTYKmDKQkZB 62KwfdYs8DE2d02ESi8vUYsFiuqP3dDyf0pw5jQMppx6J3JU3FeKFLOnRf1KvT07NVIB sZ/HV39KAaAAWSMA3feq/HUNNJqzkFZ/lkRR/8YbGn/nS8aHEoz42HiJZ+oSGedWjStH syAA== X-Gm-Message-State: AOUpUlEbnd9D2VSAXm1RjAlwRhz9MU0tIW/vGC45XpGCUohkUIr5HWjP xiCuPhhuJT2Cu8/mtDbaFFg+c61pXQ1DTA== X-Received: by 2002:a2e:59d1:: with SMTP id g78-v6mr14208599ljf.79.1532967570734; Mon, 30 Jul 2018 09:19:30 -0700 (PDT) Received: from localhost ([195.238.92.132]) by smtp.gmail.com with ESMTPSA id 20-v6sm2132740ljs.32.2018.07.30.09.19.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 30 Jul 2018 09:19:30 -0700 (PDT) From: Sam Protsenko To: u-boot@lists.denx.de Date: Mon, 30 Jul 2018 19:19:26 +0300 Message-Id: <20180730161927.14763-2-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180730161927.14763-1-semen.protsenko@linaro.org> References: <20180730161927.14763-1-semen.protsenko@linaro.org> Cc: Maxime Ripard , Tom Rini Subject: [U-Boot] [PATCH v3 1/2] env: Don't show "Failed" error message X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" "Failed" error message from env_load() only clutters the log with unnecessary details, as we already have all needed warnings by that time. Example: Loading Environment from FAT... MMC: no card present ** Bad device mmc 0 ** Failed (-5) Let's only print it in case when DEBUG is defined to keep log clear. Signed-off-by: Sam Protsenko --- Changes in v2: - Join two consecutive "if (!ret)" conditions - Add the comment with requirement for underlying API to print error message (as we don't print "Failed" message anymore) Changes in v3: - Print "Failed" message using debug() rather than removing it env/env.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/env/env.c b/env/env.c index 5c0842ac07..dc2999625b 100644 --- a/env/env.c +++ b/env/env.c @@ -195,14 +195,18 @@ int env_load(void) continue; printf("Loading Environment from %s... ", drv->name); + /* + * In error case, the error message must be printed during + * drv->load() in some underlying API, and it must be exactly + * one message. + */ ret = drv->load(); - if (ret) - printf("Failed (%d)\n", ret); - else + if (ret) { + debug("Failed (%d)\n", ret); + } else { printf("OK\n"); - - if (!ret) return 0; + } } return -ENODEV;