diff mbox series

Drop total bytes to be downloaded from progress

Message ID 20201030120520.2905668-1-sbabic@denx.de
State Accepted
Headers show
Series Drop total bytes to be downloaded from progress | expand

Commit Message

Stefano Babic Oct. 30, 2020, 12:05 p.m. UTC
Commit 029738e introduces a change of API adding the total number of
bytes to be downloaded. This breaks current API and it is temporary
remove with this patch until a suitable way to forward API changes will
be implemented.

Signed-off-by: Stefano Babic <sbabic@denx.de>
---
 core/progress_thread.c | 7 +++++--
 include/progress_ipc.h | 1 -
 2 files changed, 5 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/core/progress_thread.c b/core/progress_thread.c
index a216eaa..cc556c1 100644
--- a/core/progress_thread.c
+++ b/core/progress_thread.c
@@ -89,11 +89,15 @@  static void send_progress_msg(void)
 
 static void _swupdate_download_update(unsigned int perc, unsigned long long totalbytes)
 {
+	/*
+	 * TODO: totalbytes should be forwarded correctly
+	 * after adding it to the progress message
+	 */
 	struct swupdate_progress *pprog = &progress;
 	pthread_mutex_lock(&pprog->lock);
 	if (perc != pprog->msg.dwl_percent) {
 		pprog->msg.dwl_percent = perc;
-		pprog->msg.dwl_bytes = totalbytes;
+		totalbytes = totalbytes;
 		send_progress_msg();
 	}
 	pthread_mutex_unlock(&pprog->lock);
@@ -136,7 +140,6 @@  void swupdate_download_update(unsigned int perc, unsigned long long totalbytes)
 	if (pid == getpid()) {
 		struct progress_dwl_data *pdwl = (struct progress_dwl_data *)info;
 		pdwl->dwl_percent = perc;
-		pdwl->dwl_bytes = totalbytes;
 		notify(PROGRESS, RECOVERY_DWL, TRACELEVEL, info);
 		return;
 	}
diff --git a/include/progress_ipc.h b/include/progress_ipc.h
index deba39e..f508eda 100644
--- a/include/progress_ipc.h
+++ b/include/progress_ipc.h
@@ -27,7 +27,6 @@  struct progress_msg {
 	unsigned int	magic;		/* Magic Number */
 	RECOVERY_STATUS	status;		/* Update Status (Running, Failure) */
 	unsigned int	dwl_percent;	/* % downloaded data */
-	unsigned long long dwl_bytes;	/* total of bytes to be downloaded */
 	unsigned int	nsteps;		/* No. total of steps */
 	unsigned int	cur_step;	/* Current step index */
 	unsigned int	cur_percent;	/* % in current step */