|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [XEN PATCH] x86: address MISRA C:2012 Rule 5.3
On 10.08.2023 17:40, Nicola Vetrini wrote:
> Address some occurrences of shadowing between the global
> variable 'e820' in 'xen/arch/x86/e820.c' and the function
> parameter name of 'e820_add_range'.
>
> Since the function is only ever called with the global variable
> as the actual parameter, so there is no need to have it as a parameter
> because both are defined in the same file (mentioned above).
> This in turn causes several other functions to lose their parameter
> 'e820' because they are involved in the call chain that leads to
> 'e820_add_range'.
>
> Signed-off-by: Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx>
The changes look okay to me now, but ...
> --- a/xen/arch/x86/setup.c
> +++ b/xen/arch/x86/setup.c
> @@ -686,7 +686,7 @@ static void __init parse_video_info(void)
> #endif
> }
>
> -static void __init kexec_reserve_area(struct e820map *e820)
> +static void __init kexec_reserve_area(void)
> {
> #ifdef CONFIG_KEXEC
> unsigned long kdump_start = kexec_crash_area.start;
> @@ -700,7 +700,7 @@ static void __init kexec_reserve_area(struct e820map
> *e820)
>
> is_reserved = true;
>
> - if ( !reserve_e820_ram(e820, kdump_start, kdump_start + kdump_size) )
> + if ( !reserve_e820_ram(&boot_e820, kdump_start, kdump_start +
> kdump_size) )
> {
> printk("Kdump: DISABLED (failed to reserve %luMB (%lukB) at %#lx)"
> "\n", kdump_size >> 20, kdump_size >> 10, kdump_start);
> @@ -1308,7 +1308,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
> if ( e820.map[i].type == E820_RAM )
> nr_pages += e820.map[i].size >> PAGE_SHIFT;
> set_kexec_crash_area_size((u64)nr_pages << PAGE_SHIFT);
> - kexec_reserve_area(&boot_e820);
> + kexec_reserve_area();
>
> initial_images = mod;
> nr_initial_images = mbi->mods_count;
> @@ -1495,7 +1495,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
> reserve_e820_ram(&boot_e820, __pa(_stext), __pa(__2M_rwdata_end));
>
> /* Late kexec reservation (dynamic start address). */
> - kexec_reserve_area(&boot_e820);
> + kexec_reserve_area();
>
> setup_max_pdx(raw_max_page);
> if ( highmem_start )
... this isolated set of changes wants either breaking out into a separate
patch (as suggested before) or at least needs mentioning in the description.
Jan
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |