]> xenbits.xensource.com Git - xen.git/commitdiff
xen: Drop the (almost) unused extern start[]
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 25 Jul 2023 15:32:35 +0000 (16:32 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 26 Jul 2023 09:56:27 +0000 (10:56 +0100)
This global variable is shadowed by plenty local variables, violating MISRA
rule 5.3.  Some architectures happen to have a symbol by the name of start in
their head.S's, but it's not a useful symbol to reference from C.

In fact, the single use of the global start[] in RISC-V means to use _start[]
as the linker symbol at the beginning of the .text section, not the function
which happens to be in the same location.

Fix RISC-V to use the right symbol for it's calculation, and drop the extern.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Reviewed-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
xen/arch/riscv/mm.c
xen/include/xen/kernel.h

index fddb3cd0bdebc27678b4b38442622c809e9c079b..99ed5e9623cce0fc8794334d58b5c5c6cd93ccbc 100644 (file)
@@ -148,7 +148,7 @@ static bool __init check_pgtbl_mode_support(struct mmu_desc *mmu_desc,
 
     unsigned long aligned_load_start = load_start & level_map_mask;
     unsigned long aligned_page_size = XEN_PT_LEVEL_SIZE(page_table_level);
-    unsigned long xen_size = (unsigned long)(_end - start);
+    unsigned long xen_size = (unsigned long)(_end - _start);
 
     if ( (load_start + xen_size) > (aligned_load_start + aligned_page_size) )
     {
index 9ac2694dc7b1368306a15488b689be1356185e06..46b3c9c026258a3371cf554e683bf36ce5fd68eb 100644 (file)
@@ -66,7 +66,7 @@
 })
 
 /* SAF-0-safe */
-extern char _start[], _end[], start[];
+extern char _start[], _end[];
 #define is_kernel(p) ({                         \
     char *__p = (char *)(unsigned long)(p);     \
     (__p >= _start) && (__p < _end);            \