From 9776e654dc402fcfdab2f5ff24bcaf9840607a6d Mon Sep 17 00:00:00 2001 From: Minecrell Date: Wed, 17 Mar 2021 15:24:08 +0100 Subject: [PATCH] app: aboot: fastboot: Simplify fastboot_stage() a bit I don't think the cache invalidate is really necessary. Also, avoid copying if giving in the download_base as address (in that case we assume it was already copied there). --- app/aboot/fastboot.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/aboot/fastboot.c b/app/aboot/fastboot.c index b705f18fe..5a62b6b9e 100644 --- a/app/aboot/fastboot.c +++ b/app/aboot/fastboot.c @@ -406,15 +406,14 @@ void fastboot_okay(const char *info) void fastboot_stage(const void *data, unsigned sz) { - arch_invalidate_cache_range((addr_t) download_base, download_size); download_size = 0; - if (sz > download_max) { fastboot_fail("data too large"); return; } - memcpy(download_base, data, sz); + if (data != download_base) + memcpy(download_base, data, sz); download_size = sz; fastboot_okay("");