Message ID | 20191206213936.v6.33.I2b7cfda4af229b2b6e4ea86f51415502c40f63ac@changeid |
---|---|
State | Accepted |
Commit | 83f288f236505e2e73da8c8d2d72f97c0fe5b06b |
Delegated to: | Bin Meng |
Headers | show
Return-Path: <u-boot-bounces@lists.denx.de> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=<UNKNOWN>) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="lruw6Lt5"; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47VH9k0XvXz9sPf for <incoming@patchwork.ozlabs.org>; Sat, 7 Dec 2019 15:51:54 +1100 (AEDT) Received: from phobos.denx.de (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5311381712; Sat, 7 Dec 2019 05:48:09 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (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=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="lruw6Lt5"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4E2AE816E1; Sat, 7 Dec 2019 05:48:05 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd44.google.com (mail-io1-xd44.google.com [IPv6:2607:f8b0:4864:20::d44]) (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 9FF56816E1 for <u-boot@lists.denx.de>; Sat, 7 Dec 2019 05:48:02 +0100 (CET) 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-xd44.google.com with SMTP id z23so9430543iog.11 for <u-boot@lists.denx.de>; Fri, 06 Dec 2019 20:48:02 -0800 (PST) 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=crlpv0UjzaCUxm0N3OXzDxGbvCxQqMJDeDNIKl5MGkU=; b=lruw6Lt5AVGoT8V+X9z/DiQi/ftZUt/LE6VwKO+ClrufHyXsUO77IzwpnkxyiMmuQ1 2BZe3N6k+j7ycG1mR/+TJPIW4SZjctoQmEmBQwMR8Z6WhGpqRhOrmkEFJFG3lPomZQ1N LLQKpb/1IEzbeuKTaVyCx+ddumGskq59sEEOE= 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:mime-version:content-transfer-encoding; bh=crlpv0UjzaCUxm0N3OXzDxGbvCxQqMJDeDNIKl5MGkU=; b=ShWoetKRK4kAvsOtLpr1qncTGk5BMZeg50abTgc6qmoATItgwPowH0Ur+6kA+KfXzT KoExq53U4sDmNCCT3kgB4VkgJnUpZaya1fjqGPqXqqkpRG0jCxReGqA9rtEKApkHUWhN mjXiyziolYKp8K0KwES75Y40XJNwAjoE9LXzqISThElJbX3Ago2HHFkcraiYeqNTeSHC Kvbv0KiZ72TYtjYj4C20GyG25+Mn1IopL4v+JG7gTTCyHDlbUE4kjmTPGbJjd/UD/T01 qOlLVv4Y4Fu05D4o/xDQ7Wq74i+1W+dkVblar3c+Z4fIGA+NYgSViemyi03pcoR5mqpQ NGFw== X-Gm-Message-State: APjAAAVpGqtjCvtsCNKe2Mb9gypcy+Gzlqn2vLNakxPYVMv8JsGKY/Kr NziblyeGkd4UM2TSVpGY3neVH7XBVQE= X-Google-Smtp-Source: APXvYqwEQIjB2fMQZVLWKk10ooBsyf8mmhMEJfWdW6GxLfxVA0eXCfBHykJYjuMNqHr52djG6mjNfw== X-Received: by 2002:a02:c7cf:: with SMTP id s15mr16375627jao.15.1575694081352; Fri, 06 Dec 2019 20:48:01 -0800 (PST) Received: from kiwi.bld.corp.google.com ([2620:15c:183:0:8223:87c:a681:66aa]) by smtp.gmail.com with ESMTPSA id o7sm4549410ilo.58.2019.12.06.20.48.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Dec 2019 20:48:01 -0800 (PST) From: Simon Glass <sjg@chromium.org> To: U-Boot Mailing List <u-boot@lists.denx.de> Subject: [PATCH v6 033/102] x86: Tidy up error handling in mrccache_save() Date: Fri, 6 Dec 2019 21:42:06 -0700 Message-Id: <20191206213936.v6.33.I2b7cfda4af229b2b6e4ea86f51415502c40f63ac@changeid> X-Mailer: git-send-email 2.24.0.393.g34dc348eaf-goog In-Reply-To: <20191207044315.51770-1-sjg@chromium.org> References: <20191207044315.51770-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.26 Precedence: list List-Id: U-Boot discussion <u-boot.lists.denx.de> List-Unsubscribe: <https://lists.denx.de/options/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=unsubscribe> List-Archive: <https://lists.denx.de/pipermail/u-boot/> List-Post: <mailto:u-boot@lists.denx.de> List-Help: <mailto:u-boot-request@lists.denx.de?subject=help> List-Subscribe: <https://lists.denx.de/listinfo/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=subscribe> Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" <u-boot-bounces@lists.denx.de> X-Virus-Scanned: clamav-milter 0.101.4 at phobos.denx.de X-Virus-Status: Clean |
Series |
x86: Add initial support for apollolake
|
expand
|
On Sat, Dec 7, 2019 at 12:48 PM Simon Glass <sjg@chromium.org> wrote: > > This function is a bit confusing at present due to the error handling. > Update it to remove the goto, returning errors as they happen. > > While we are here, use hex for the data size since this is the norm in > U-Boot. > > Signed-off-by: Simon Glass <sjg@chromium.org> > Reviewed-by: Bin Meng <bmeng.cn@gmail.com> > --- > > Changes in v6: None > Changes in v5: None > Changes in v4: None > Changes in v3: > - Move an additional error handling fix from a future patch > > Changes in v2: None > > arch/x86/lib/mrccache.c | 19 +++++++------------ > 1 file changed, 7 insertions(+), 12 deletions(-) > applied to u-boot-x86/next, thanks!
diff --git a/arch/x86/lib/mrccache.c b/arch/x86/lib/mrccache.c index 6e561fe528..712bacd5d2 100644 --- a/arch/x86/lib/mrccache.c +++ b/arch/x86/lib/mrccache.c @@ -168,7 +168,7 @@ int mrccache_update(struct udevice *sf, struct mrc_region *entry, cur); if (ret) { debug("Failed to write to SPI flash\n"); - return ret; + return log_msg_ret("Cannot update mrccache", ret); } return 0; @@ -261,28 +261,23 @@ int mrccache_save(void) if (!gd->arch.mrc_output_len) return 0; - debug("Saving %d bytes of MRC output data to SPI flash\n", + debug("Saving %#x bytes of MRC output data to SPI flash\n", gd->arch.mrc_output_len); ret = mrccache_get_region(&sf, &entry); if (ret) - goto err_entry; + return log_msg_ret("Cannot get region", ret); ret = device_probe(sf); if (ret) - goto err_entry; + return log_msg_ret("Cannot probe device", ret); cache = gd->arch.mrc_cache; ret = mrccache_update(sf, &entry, cache); - if (!ret) { + if (!ret) debug("Saved MRC data with checksum %04x\n", cache->checksum); - } else if (ret == -EEXIST) { + else if (ret == -EEXIST) debug("MRC data is the same as last time, skipping save\n"); - ret = 0; - } -err_entry: - if (ret) - debug("%s: Failed: %d\n", __func__, ret); - return ret; + return 0; } int mrccache_spl_save(void)