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; From patchwork Mon Jul 30 16:19:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 143150 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp4267248ljj; Mon, 30 Jul 2018 09:21:01 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdh1EWjE7g2dwGGP5/QYXIrxiKkoJBh+6wD8ni/U6PqSsMAzSFLEQCBEiNXaaLW/DZMCqW9 X-Received: by 2002:a50:d65e:: with SMTP id c30-v6mr9138007edj.178.1532967661341; Mon, 30 Jul 2018 09:21:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532967661; cv=none; d=google.com; s=arc-20160816; b=DBw1S/w1xfA9eIwCLuBX05QG7Z6qvRi8tBQwZVMJ5zzAPSZTEdqN/IILBVggjnb3TJ A0gj086eKYqf3rNBNtBGHYFBuQEiMJzbdcxtZtkX8Z1hDeOqUbP6u3PStLFBlbc5p1RL DHPgSv0pHfipRVPkI5DHLQM+sxgTQmOa7ePFunueR01RL8JnuxY79Ulrpri+LPVnTd5i PfJmX+8a+rZKFyvkIzPQAN6vZAjx0/M4R5mjW06/5k+omBSg/g4FwV7AV47OgrPhrSge jJkvNNNC4CKfhT2m4JU4DTzhrZSNFnDG28xhJehZoox67Z8Szj/uhSiD+StFHP0svh0L UitQ== 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=3foMRkMfAKxV/ito9b9uxO6SDtf86bWVwz+f8ZuxHb8=; b=QCiyHg+ALfHv9BnBlf/htlwB2GR7Rn1Ji+MMHHZAV4oXFPObR2GN2a8SgMVJ5eode8 Cjguet0DEMT6DHNA9MaNphyh1e/yORdAlXGDuZcr4jcwXODbZYP03yWVskwCSdJKf8d7 4KZrKXKAvvWnY3GQQipnQE/Rz9RPSjmHhxOhNr7XVUs+/VDVbR40nb5RiI1smFx0I6UI 4slJVAOs0FZPejSvClC7WrC2Dc//Ebgn51eMMPxoqjyHw/TghOsfmcMt6nQlKpFfn0Au LRP05Ua22fjoWhwZY/GJwOD/dxicByhtwob0/6Uwe/AZwciU4eeC6K0ThQrR+1AeIX+y DZdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=PlXAechr; 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 d1-v6si1243843edn.311.2018.07.30.09.21.01; Mon, 30 Jul 2018 09:21:01 -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=PlXAechr; 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 E7F4FC22041; Mon, 30 Jul 2018 16:20:10 +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 F25B8C22048; Mon, 30 Jul 2018 16:19:46 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 343E1C22071; Mon, 30 Jul 2018 16:19:36 +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 DCED9C22048 for ; Mon, 30 Jul 2018 16:19:32 +0000 (UTC) Received: by mail-lj1-f194.google.com with SMTP id p6-v6so11012924ljc.5 for ; Mon, 30 Jul 2018 09:19:32 -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=dYTe6S7X/SepK5g3BpCmirZf1HDleGelpeF5WY6tdFQ=; b=PlXAechrlhghvNbJ7qQDpvpEb4E73IL7piixcAw3Wg0Mkiea6rC53r9vszkyLE8KFO SUD/REzsmIJkZ1KPxx9Wqn4CQIo9cHdEsHQMvGd1pkUadQGbDZLAFpYqp6VhldKsLEHn mxSufMF/fCy8PnV2eOMfxoCAJ9ucasxpLJeDU= 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=dYTe6S7X/SepK5g3BpCmirZf1HDleGelpeF5WY6tdFQ=; b=V07ZiY5m0yGl3t2EQmD5KAu3CSnBPa3aoA67wvuNjT2k+OuGSYvEciquMOLCzIo7gR 3DA85ib1rjHsQFvFQRCAMr6uKVi/M5CiAqYQo0Cg2B+MZhOFri4ZVMyWdExKZTc0Ekfj dl2PJiC/kQOYNEsF0SSE2lIO0KnuDWcmhZ1rnpRCpBlpMshD1wEV1AgSQyW/n5JUwfl5 Q+GBpsJknS879jFnt5J70FIta4jB4LktEoqMFkyAdk/OG/V6/I+/0QfsiDX4TVSJ8lKQ eMZbTtCgwu2ziBXpj4HTLRgYZ3/GeCsLw3dJ71M66i3VLQPSWvYNh4ydCdrHWcpfnKxm nngw== X-Gm-Message-State: AOUpUlHg7Mtm9S2G7Wn8wgNU3NwX/4jCDIuG0MxYp68Mhg7qOCnrs1iO 1vWf/EWRNL85oYlIaxR/TMr2iIOGZ6ixWA== X-Received: by 2002:a2e:10ca:: with SMTP id 71-v6mr13732217ljq.59.1532967572171; Mon, 30 Jul 2018 09:19:32 -0700 (PDT) Received: from localhost ([195.238.92.132]) by smtp.gmail.com with ESMTPSA id u203-v6sm1606617lff.40.2018.07.30.09.19.31 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 30 Jul 2018 09:19:31 -0700 (PDT) From: Sam Protsenko To: u-boot@lists.denx.de Date: Mon, 30 Jul 2018 19:19:27 +0300 Message-Id: <20180730161927.14763-3-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 2/2] disk: part: Don't show redundant 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" Underlying API should already print some meaningful error message, so this one is just brings more noise. E.g. we can see log like this: MMC: no card present ** Bad device mmc 0 ** Obviously, second error message is unwanted. Let's only print it in case when DEBUG is defined to keep log short and clear. Signed-off-by: Sam Protsenko --- Changes in v2: - Instead of removing error message, print it with debug() Changes in v3: - None disk/part.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/disk/part.c b/disk/part.c index 9266a09ec3..9e457a6e72 100644 --- a/disk/part.c +++ b/disk/part.c @@ -400,7 +400,7 @@ int blk_get_device_by_str(const char *ifname, const char *dev_hwpart_str, *dev_desc = get_dev_hwpart(ifname, dev, hwpart); if (!(*dev_desc) || ((*dev_desc)->type == DEV_TYPE_UNKNOWN)) { - printf("** Bad device %s %s **\n", ifname, dev_hwpart_str); + debug("** Bad device %s %s **\n", ifname, dev_hwpart_str); dev = -ENOENT; goto cleanup; }