[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen staging] xen/arm: Pass struct kernel_info parameter to make_{resv,shm}_memory_node



commit 8d5ff144773dd326ce526173655a919d471a8cfc
Author:     Luca Fancellu <luca.fancellu@xxxxxxx>
AuthorDate: Thu Apr 18 08:36:43 2024 +0100
Commit:     Julien Grall <jgrall@xxxxxxxxxx>
CommitDate: Wed Apr 24 19:13:35 2024 +0100

    xen/arm: Pass struct kernel_info parameter to make_{resv,shm}_memory_node
    
    The struct domain parameter is not used in make_resv_memory_node and in
    its called function make_shm_memory_node, so drop it from both functions,
    also, take the occasion to pass directly struct kernel_info, from which
    we can infer other parameters passed to the functions and drop them as
    well.
    
    Signed-off-by: Luca Fancellu <luca.fancellu@xxxxxxx>
    Reviewed-by: Michal Orzel <michal.orzel@xxxxxxx>
---
 xen/arch/arm/dom0less-build.c           |  3 +--
 xen/arch/arm/domain_build.c             |  3 +--
 xen/arch/arm/include/asm/static-shmem.h |  9 ++++-----
 xen/arch/arm/static-shmem.c             | 16 +++++++++-------
 4 files changed, 15 insertions(+), 16 deletions(-)

diff --git a/xen/arch/arm/dom0less-build.c b/xen/arch/arm/dom0less-build.c
index fb63ec6fd1..0edc5357ca 100644
--- a/xen/arch/arm/dom0less-build.c
+++ b/xen/arch/arm/dom0less-build.c
@@ -645,8 +645,7 @@ static int __init prepare_dtb_domU(struct domain *d, struct 
kernel_info *kinfo)
     if ( ret )
         goto err;
 
-    ret = make_resv_memory_node(d, kinfo->fdt, addrcells, sizecells,
-                                &kinfo->shm_mem);
+    ret = make_resv_memory_node(kinfo, addrcells, sizecells);
     if ( ret )
         goto err;
 
diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 54232ed4cb..11d4e7d0b1 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -1769,8 +1769,7 @@ static int __init handle_node(struct domain *d, struct 
kernel_info *kinfo,
                 return res;
         }
 
-        res = make_resv_memory_node(d, kinfo->fdt, addrcells, sizecells,
-                                    &kinfo->shm_mem);
+        res = make_resv_memory_node(kinfo, addrcells, sizecells);
         if ( res )
             return res;
     }
diff --git a/xen/arch/arm/include/asm/static-shmem.h 
b/xen/arch/arm/include/asm/static-shmem.h
index 1536ff18b8..680594b684 100644
--- a/xen/arch/arm/include/asm/static-shmem.h
+++ b/xen/arch/arm/include/asm/static-shmem.h
@@ -7,8 +7,8 @@
 
 #ifdef CONFIG_STATIC_SHM
 
-int make_resv_memory_node(const struct domain *d, void *fdt, int addrcells,
-                          int sizecells, const struct meminfo *mem);
+int make_resv_memory_node(const struct kernel_info *kinfo, int addrcells,
+                          int sizecells);
 
 int process_shm(struct domain *d, struct kernel_info *kinfo,
                 const struct dt_device_node *node);
@@ -26,9 +26,8 @@ int process_shm_node(const void *fdt, int node, uint32_t 
address_cells,
 
 #else /* !CONFIG_STATIC_SHM */
 
-static inline int make_resv_memory_node(const struct domain *d, void *fdt,
-                                        int addrcells, int sizecells,
-                                        const struct meminfo *mem)
+static inline int make_resv_memory_node(const struct kernel_info *kinfo,
+                                        int addrcells, int sizecells)
 {
     return 0;
 }
diff --git a/xen/arch/arm/static-shmem.c b/xen/arch/arm/static-shmem.c
index 40a0e860c7..349b856676 100644
--- a/xen/arch/arm/static-shmem.c
+++ b/xen/arch/arm/static-shmem.c
@@ -277,10 +277,11 @@ int __init process_shm(struct domain *d, struct 
kernel_info *kinfo,
     return 0;
 }
 
-static int __init make_shm_memory_node(const struct domain *d, void *fdt,
-                                       int addrcells, int sizecells,
-                                       const struct meminfo *mem)
+static int __init make_shm_memory_node(const struct kernel_info *kinfo,
+                                       int addrcells, int sizecells)
 {
+    const struct meminfo *mem = &kinfo->shm_mem;
+    void *fdt = kinfo->fdt;
     unsigned int i = 0;
     int res = 0;
 
@@ -488,10 +489,11 @@ int __init process_shm_node(const void *fdt, int node, 
uint32_t address_cells,
     return 0;
 }
 
-int __init make_resv_memory_node(const struct domain *d, void *fdt,
-                                 int addrcells, int sizecells,
-                                 const struct meminfo *mem)
+int __init make_resv_memory_node(const struct kernel_info *kinfo, int 
addrcells,
+                                 int sizecells)
 {
+    const struct meminfo *mem = &kinfo->shm_mem;
+    void *fdt = kinfo->fdt;
     int res = 0;
     /* Placeholder for reserved-memory\0 */
     const char resvbuf[16] = "reserved-memory";
@@ -518,7 +520,7 @@ int __init make_resv_memory_node(const struct domain *d, 
void *fdt,
     if ( res )
         return res;
 
-    res = make_shm_memory_node(d, fdt, addrcells, sizecells, mem);
+    res = make_shm_memory_node(kinfo, addrcells, sizecells);
     if ( res )
         return res;
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.