diff mbox series

[V3,03/10] IPC: drop unused parameter and change name

Message ID 20201116091445.797119-4-sbabic@denx.de
State Accepted
Headers show
Series Rework and extend IPC for install | expand

Commit Message

Stefano Babic Nov. 16, 2020, 9:14 a.m. UTC
The "info" buffer used to trigger an update is quite unused. The name of
the original SWU is pushed in case of local update, but it is not used.
Drop the filename and change the name to a more generic data, as this
will be used to pass a request structure with several fields instead of
pure formatted strings.

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

Patch

diff --git a/core/network_thread.c b/core/network_thread.c
index 698c139..2c383b7 100644
--- a/core/network_thread.c
+++ b/core/network_thread.c
@@ -350,7 +350,6 @@  void *network_thread (void *data)
 				if (instp->status == IDLE) {
 					instp->fd = ctrlconnfd;
 					instp->source = msg.data.instmsg.source;
-					instp->len = min(msg.data.instmsg.len, sizeof(instp->info));
 
 					/*
 					 * Communicate if a dry run is asked and set it
@@ -360,9 +359,6 @@  void *network_thread (void *data)
 					else
 						instp->dry_run = 0;
 
-					memcpy(instp->info, msg.data.instmsg.buf,
-						instp->len);
-
 					/*
 					 * Prepare answer
 					 */
diff --git a/core/stream_interface.c b/core/stream_interface.c
index 8285c72..633116d 100644
--- a/core/stream_interface.c
+++ b/core/stream_interface.c
@@ -607,8 +607,7 @@  void *network_initializer(void *data)
 int get_install_info(sourcetype *source, char *buf, size_t len)
 {
 	len = min(len, inst.len);
-
-	memcpy(buf, inst.info, len);
+	memcpy(buf, inst.data, len);
 	*source = inst.source;
 
 	return len;
diff --git a/include/installer_priv.h b/include/installer_priv.h
index a84143d..9322a68 100644
--- a/include/installer_priv.h
+++ b/include/installer_priv.h
@@ -19,7 +19,7 @@  struct installer {
 	sourcetype source; 		/* Who triggered the update */
 	int	dry_run;		/* set it if no changes in hardware must be done */
 	unsigned int len;    		/* Len of data valid in info, data is optional */
-	char	info[2048];   		/* info */
+	char	data[2048];   		/* This is a placeholder for installation request */
 };
 
 #endif