From patchwork Fri Jul 20 15:18:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 142480 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp3093786ljj; Fri, 20 Jul 2018 08:19:38 -0700 (PDT) X-Google-Smtp-Source: AAOMgpe34toTHKQOhfxRomHCY22f72RSqkJ1i+XsziDZG2xfDflr8QDPvL1d/iZ48LOxmbt2rH9E X-Received: by 2002:a50:ad0f:: with SMTP id y15-v6mr3089752edc.78.1532099978564; Fri, 20 Jul 2018 08:19:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532099978; cv=none; d=google.com; s=arc-20160816; b=yg5ewGPG4WjC2aFsl3rHdZJhZTSkz92hskPtFjIqzytvnTFo66gcKgpYFIBQBSBdOo PvZcCmeVPPL/FX+7ZoGIH6DPGvTW9MkS45oObR7pcADWFLvtKxPyuTMr4z6FNXmY8Lkp BQ1lFLTvFcAl8xaCr+pdipi3zBgQiSsVCyJKYCBpIr5n6V11eFURnpwFRLqXth3MzFpP YQaHaaTD1ERdFKzun9u4srjLFAoQGy+CLogk3VBvmmNzvWokgXCcOwCreMMidQR/j0DJ jizVpIIROdOX+MMdTXtjw1Nkj9ZTuP84KaOhE1Q5eWWA65PcVKRnFe+3JM3f/c7gleNb zeFg== 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=ZvNtQR8IdekDtEbTYgC53/7IraHidDzbFRwt9T3nF/k=; b=LrDEWAimVQAg8nWED0bcMmZ3wlgXHmD0dbPw8mw/EqhANvHbevPdMkYSXpcBoVgMeE e9sgcY0yMmWPmThAN3y1nlj3gcoTKXwq4pyEmSAg2p0Rbb8gETigwjZ23JwxBhW/gmHf qQaFdDwcBs7T+zXcAsgesu6s9F5wi8zol3S4CqlkbEcJyJf5UWSdh2R60Puj4+ER6zWl wXVn1DjBPc/hMbvGV8MEf5dV/YeFIpioPINwV5Wbg6+n6Pen/dX89acBZWyUQnVYtlsw 7wP61PlUHwXDfajUAGEfRkXcOfYZAQLEj6sZntVfb/jLVUp89Nt9pi8KSaIdf+LW1vy6 DzYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=OSEujhmm; 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 g63-v6si933354ede.218.2018.07.20.08.19.38; Fri, 20 Jul 2018 08:19:38 -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=OSEujhmm; 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 1BCECC21DC1; Fri, 20 Jul 2018 15:19:20 +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 A97E6C21DFF; Fri, 20 Jul 2018 15:19:07 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 64140C21E0D; Fri, 20 Jul 2018 15:19:02 +0000 (UTC) Received: from mail-lf1-f67.google.com (mail-lf1-f67.google.com [209.85.167.67]) by lists.denx.de (Postfix) with ESMTPS id EB655C21CB1 for ; Fri, 20 Jul 2018 15:19:00 +0000 (UTC) Received: by mail-lf1-f67.google.com with SMTP id l16-v6so2053663lfc.13 for ; Fri, 20 Jul 2018 08:19:00 -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=VYCRxU+TmzFsIlj4KgwV0Ev+wUPFnTxzln6/vNxm2/s=; b=OSEujhmmywzg6JDcrBpWkslILcARmIzpC45VJLHV21IJ8SnR813xsjWORkoM3/q4wc h0K7qrgXmGz7HO3YxZIuoOkFXpXsa6dPPGsHS0Syx7+JKqhIyCH9OS34dHi2S0sPPGGB TsYU0FcjLmtENvl51BGX2dRS6UyrRl4Dfz5hs= 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=VYCRxU+TmzFsIlj4KgwV0Ev+wUPFnTxzln6/vNxm2/s=; b=rSz91EHaGfDJEiND9qnZuyXUdxTX1Wmi/rb4IdAP9cJCCvqPQtdZ/M9nx4QEApYn2L TSpfJr+JAv9nVF4HmfxTagOm5xVW7IUx8vmf3A4di6bGbQ5PMpmNb/4kGicIdDlMQpM8 FaPdaYqqIJEYwhjMjl9ptvHxyyDsPc+nyquy8fodNiu00f2ZrilglHaUEcJhDO/5KyhT on8kVGYqldsYVTy5yMfcekZvpgFY/uEbvpPnkO/AawbbSzUiUdNS/6I8ARhH2yAGpgei pnd73oRweXNG6XX1cyKSnelouTuRmhbn5Kx1sdxBdbrIfDEK49xP2OvexLRFmOP1Wqo1 orkw== X-Gm-Message-State: AOUpUlEC0GmedCy26cRgMhs4K3O3Zf2ek0b48qUAWJsrRP6tN3naBzIo m4bSLS1GCKLdseJb8Kx2x/26YA+sXZYPJA== X-Received: by 2002:a19:9b50:: with SMTP id d77-v6mr1681330lfe.108.1532099940157; Fri, 20 Jul 2018 08:19:00 -0700 (PDT) Received: from localhost ([195.238.92.132]) by smtp.gmail.com with ESMTPSA id h40-v6sm332358lfi.84.2018.07.20.08.18.59 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Jul 2018 08:18:59 -0700 (PDT) From: Sam Protsenko To: u-boot@lists.denx.de Date: Fri, 20 Jul 2018 18:18:55 +0300 Message-Id: <20180720151856.23458-2-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180720151856.23458-1-semen.protsenko@linaro.org> References: <20180720151856.23458-1-semen.protsenko@linaro.org> Cc: Maxime Ripard , Tom Rini Subject: [U-Boot] [PATCH v2 1/2] env: Don't print "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) Remove this "Failed" message to keep log short and 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) env/env.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/env/env.c b/env/env.c index 5c0842ac07..c830001eee 100644 --- a/env/env.c +++ b/env/env.c @@ -195,14 +195,16 @@ 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) { printf("OK\n"); - - if (!ret) return 0; + } } return -ENODEV; From patchwork Fri Jul 20 15:18:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 142481 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp3094373ljj; Fri, 20 Jul 2018 08:20:14 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeGNHTV7XHJIETlifB+uzummal0WSSZQcIFcJYIDEbuwfS88RuE2jWfWIZponoEYWB57a7B X-Received: by 2002:a50:c211:: with SMTP id n17-v6mr1031078edf.11.1532100014842; Fri, 20 Jul 2018 08:20:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532100014; cv=none; d=google.com; s=arc-20160816; b=RSSkXUBGvZLOMiiQ8SEGTVJJUCCUlSbqMh8Tepy8X7VLiteQYiofFIq7Z0E1X9YIML YaqJjV4jO7/7EEY7oQfg84c2QYbrTYs03vO4zcTTj9lcIk34R2ziQTKrPxbQAGv6s3+o +wZquqjcudftaiSxFMO8ZYnajgUH3eDz59+n2NYk6tuRWhkc9O48VHs68soPT82yUZeF 2HKc6D6O9trTPM6bBJrEzFhmAgBlDvrS40kQrpR3wMucfXxPw4OZ0Mjh/g0vNpfOewFq r1Lg6UfJSHDzhcY3w44Ad6cwd+EYiBGo9HqOcByy3lXDVq/o+tWEYSdNFSP/LAkSVHOc slMQ== 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=ln8yoJiJV50q28ur/a9shSHr55j5ThEbFy8c8TsYwRA=; b=ZhBrR6cDTzJL6HCg3mVEclVHoynqcPXZF0uNlLayv8H5NQafMZTTyhYr6yGHt00575 WRmP7jCVANYmuT0PvEbgfbOVB4GMGd69/il9sfjd5iD181ST3tKMHFQNefrLrAMdPFy6 7Fd6lBbQipV3I012hN9jaNf1MciQbW5Qlp212AKp61QdXWYsv+yE5jPE4C2Xt7A1oDoY yTb9u1QCDPRJ7VdBuWR3W3NP54Wmy1vtHgGENYnF/OULzlaaWAVWfBVn5y2mPp9vAyzM K8TrMjlLDoBE0rqdlGWWmklx/cKyLjdWay/mD5rb3klGoTRo0OZ9VsO1kcYZsm6MKP+N RAwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b="VuO43/MM"; 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 o57-v6si2251579edo.114.2018.07.20.08.20.14; Fri, 20 Jul 2018 08:20:14 -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="VuO43/MM"; 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 6E403C21E88; Fri, 20 Jul 2018 15:19:36 +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 84444C21E39; Fri, 20 Jul 2018 15:19:10 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id A6531C21E36; Fri, 20 Jul 2018 15:19:05 +0000 (UTC) Received: from mail-lj1-f195.google.com (mail-lj1-f195.google.com [209.85.208.195]) by lists.denx.de (Postfix) with ESMTPS id 8107FC21E15 for ; Fri, 20 Jul 2018 15:19:02 +0000 (UTC) Received: by mail-lj1-f195.google.com with SMTP id r13-v6so11455992ljg.10 for ; Fri, 20 Jul 2018 08:19:02 -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=xtU2eV2vQP76zSOAOj2nOCv7VCYm+qOQdB/N8bgAbw4=; b=VuO43/MMQ0IRVONZg3yauY5jPDz8fNieNwerx/p1aeninHjFG3bXoj4ncxcr0r4719 6yKdFEofV6bvR2YA42E9LreQGGD5G/7vZtvIhE+XWK29wEJ6k+NufCZz/1BAnYlD5yzH w9DrhCxglr/TsC6lh/x9E001VbtLqaqEKDihY= 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=xtU2eV2vQP76zSOAOj2nOCv7VCYm+qOQdB/N8bgAbw4=; b=FYtvLgaEwqED+18W+xWlDdy1Tsm6Ng5OAj7HC1mtea6rR+6FXF+bCqx+PIyzZopu4h RKu1pXvPsclM3n7HJptbmxEAGjsrlKF8i6p1Q36oIbxCuBhrnb7RXj2HfctkAUgaQNUS 2ZFprMJpXFtKBuC0cSB9NMr+axJhxSpVxXbVbkSEvYrxU1Wel0tC2S8y4VJf/3AQAJFZ DDtHHsTflFWfMMKPmwPeZzPqd1XRjEmPTjAQ+jUEeUIxYYm92F5OK2UGng6N5z5Ayhxy JHo5izdS8XN47g4szTwdOM3E0nGFH+rWiB5q8T972XdK3GUcBtdCPmL+rG/2eOAesVFu croQ== X-Gm-Message-State: AOUpUlH6adHCu0W6OhTSR1Zq2ItBxjXWX8jWf/R1X10kC06vNx6Q85ZS IHEIsWl9XFa+OoVhnSwIXit415lXYutY3w== X-Received: by 2002:a2e:40c6:: with SMTP id r67-v6mr1961322lje.41.1532099941696; Fri, 20 Jul 2018 08:19:01 -0700 (PDT) Received: from localhost ([195.238.92.132]) by smtp.gmail.com with ESMTPSA id 1-v6sm409839ljd.11.2018.07.20.08.19.00 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Jul 2018 08:19:01 -0700 (PDT) From: Sam Protsenko To: u-boot@lists.denx.de Date: Fri, 20 Jul 2018 18:18:56 +0300 Message-Id: <20180720151856.23458-3-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180720151856.23458-1-semen.protsenko@linaro.org> References: <20180720151856.23458-1-semen.protsenko@linaro.org> Cc: Maxime Ripard , Tom Rini Subject: [U-Boot] [PATCH v2 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 Reviewed-by: Simon Glass --- Changes in v2: - Instead of removing error message, print it with debug() 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; }