diff mbox

[U-Boot,v2,24/55] x86: Don't show an error when the MRC cache is up to date

Message ID 1453072320-24298-25-git-send-email-sjg@chromium.org
State Accepted
Delegated to: Bin Meng
Headers show

Commit Message

Simon Glass Jan. 17, 2016, 11:11 p.m. UTC
When the final MRC cache record is the same as the one we want to write, we
skip writing since there is no point. This is normal behaviour.

Avoiding printing an error when this happens.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
---

Changes in v2: None

 arch/x86/lib/mrccache.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

Bin Meng Jan. 21, 2016, 8 a.m. UTC | #1
On Mon, Jan 18, 2016 at 7:11 AM, Simon Glass <sjg@chromium.org> wrote:
> When the final MRC cache record is the same as the one we want to write, we
> skip writing since there is no point. This is normal behaviour.
>
> Avoiding printing an error when this happens.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
> ---
>
> Changes in v2: None
>
>  arch/x86/lib/mrccache.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>

applied to u-boot-x86/master, thanks!
diff mbox

Patch

diff --git a/arch/x86/lib/mrccache.c b/arch/x86/lib/mrccache.c
index 53a1259..67bace4 100644
--- a/arch/x86/lib/mrccache.c
+++ b/arch/x86/lib/mrccache.c
@@ -243,8 +243,12 @@  int mrccache_save(void)
 		goto err_entry;
 	data  = (struct mrc_data_container *)gd->arch.mrc_output;
 	ret = mrccache_update(sf, &entry, data);
-	if (!ret)
+	if (!ret) {
 		debug("Saved MRC data with checksum %04x\n", data->checksum);
+	} else if (ret == -EEXIST) {
+		debug("MRC data is the same as last time, skipping save\n");
+		ret = 0;
+	}
 
 err_entry:
 	if (ret)