Since kho_add_subtree() now accepts arbitrary data blobs (not just
FDTs), rename the parameter from 'fdt' to 'blob' to better reflect
its purpose. Apply the same rename to kho_remove_subtree() for
consistency.
Signed-off-by: Breno Leitao <leitao@debian.org>
---
include/linux/kexec_handover.h | 8 ++++----
kernel/liveupdate/kexec_handover.c | 18 +++++++++---------
2 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/include/linux/kexec_handover.h b/include/linux/kexec_handover.h
index abb1d324f42d0..0666cf298c7f4 100644
--- a/include/linux/kexec_handover.h
+++ b/include/linux/kexec_handover.h
@@ -32,8 +32,8 @@ void kho_restore_free(void *mem);
struct folio *kho_restore_folio(phys_addr_t phys);
struct page *kho_restore_pages(phys_addr_t phys, unsigned long nr_pages);
void *kho_restore_vmalloc(const struct kho_vmalloc *preservation);
-int kho_add_subtree(const char *name, void *fdt, size_t size);
-void kho_remove_subtree(void *fdt);
+int kho_add_subtree(const char *name, void *blob, size_t size);
+void kho_remove_subtree(void *blob);
int kho_retrieve_subtree(const char *name, phys_addr_t *phys);
void kho_memory_init(void);
@@ -97,12 +97,12 @@ static inline void *kho_restore_vmalloc(const struct kho_vmalloc *preservation)
return NULL;
}
-static inline int kho_add_subtree(const char *name, void *fdt, size_t size)
+static inline int kho_add_subtree(const char *name, void *blob, size_t size)
{
return -EOPNOTSUPP;
}
-static inline void kho_remove_subtree(void *fdt) { }
+static inline void kho_remove_subtree(void *blob) { }
static inline int kho_retrieve_subtree(const char *name, phys_addr_t *phys)
{
diff --git a/kernel/liveupdate/kexec_handover.c b/kernel/liveupdate/kexec_handover.c
index ad2da9e4e6a04..b1f3222a0052a 100644
--- a/kernel/liveupdate/kexec_handover.c
+++ b/kernel/liveupdate/kexec_handover.c
@@ -723,13 +723,13 @@ static void __init kho_reserve_scratch(void)
}
/**
- * kho_add_subtree - record the physical address of a sub FDT in KHO root tree.
+ * kho_add_subtree - record the physical address of a sub blob in KHO root tree.
* @name: name of the sub tree.
- * @fdt: the sub tree blob.
+ * @blob: the sub tree blob.
* @size: size of the blob in bytes.
*
* Creates a new child node named @name in KHO root FDT and records
- * the physical address of @fdt. The pages of @fdt must also be preserved
+ * the physical address of @blob. The pages of @blob must also be preserved
* by KHO for the new kernel to retrieve it after kexec.
*
* A debugfs blob entry is also created at
@@ -738,9 +738,9 @@ static void __init kho_reserve_scratch(void)
*
* Return: 0 on success, error code on failure
*/
-int kho_add_subtree(const char *name, void *fdt, size_t size)
+int kho_add_subtree(const char *name, void *blob, size_t size)
{
- phys_addr_t phys = virt_to_phys(fdt);
+ phys_addr_t phys = virt_to_phys(blob);
void *root_fdt = kho_out.fdt;
int err = -ENOMEM;
int off, fdt_err;
@@ -763,7 +763,7 @@ int kho_add_subtree(const char *name, void *fdt, size_t size)
if (err < 0)
goto out_pack;
- WARN_ON_ONCE(kho_debugfs_fdt_add(&kho_out.dbg, name, fdt, size, false));
+ WARN_ON_ONCE(kho_debugfs_fdt_add(&kho_out.dbg, name, blob, size, false));
out_pack:
fdt_pack(root_fdt);
@@ -772,9 +772,9 @@ int kho_add_subtree(const char *name, void *fdt, size_t size)
}
EXPORT_SYMBOL_GPL(kho_add_subtree);
-void kho_remove_subtree(void *fdt)
+void kho_remove_subtree(void *blob)
{
- phys_addr_t target_phys = virt_to_phys(fdt);
+ phys_addr_t target_phys = virt_to_phys(blob);
void *root_fdt = kho_out.fdt;
int off;
int err;
@@ -796,7 +796,7 @@ void kho_remove_subtree(void *fdt)
if ((phys_addr_t)*val == target_phys) {
fdt_del_node(root_fdt, off);
- kho_debugfs_fdt_remove(&kho_out.dbg, fdt);
+ kho_debugfs_fdt_remove(&kho_out.dbg, blob);
break;
}
}
--
2.47.3