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

Re: [XEN PATCH] x86: address MISRA C:2012 Rule 5.3


  • To: Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 10 Aug 2023 17:52:32 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Z60Ti2fMSVeqHGDewhZxhZipQmInqV1YQBGZbZPUA8Q=; b=IuLn4xS5zooENP/UkYm2aVSArWR5dqVfjxYNk2OWq88uxLFvLzIXKdbCtpeJPZM5o+/ecQU+N1XqpdSUuJXrfRERAC92YuCb+9PgSEKtRmZXZ0OOjR+B5jmEGdKCBVRZn4WydsLPfpIBq7Qmzl1KMQVx0qLllS45QYU+apqcpfaOcY7TEXuqgCFD+7cfcUuqyxwCGBqOwipvbrwmwdL0yJ1IBRaYW/HKXazc+sHjZy4o7g7ESQYPC59kWMAAdY0pBXf2S+EtYeDsy2OZynWFc9s9BRkcO8n13McSCRR3Inc3+31ji8RslxG840ewS3+aWywUYrPvwfnH8Mo6UpM52w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fy1yztWJnftEHBxbd++hiCIHnNmE/TNxQVuVWTliGY9pSe03gVIrdpKJ0ISIbSZ9fLnQKkOpaq55576jr2iDKCVIN5uP/9pNJeWjGhKB6omAvHgVVgpeB22QxBabwZc+IDsjvYM4W4eK/Lra8X1w8xsvWg7J0Wzj3kH1vmtSJy5ZgQYSGRkBEt0redIHIO5falcpJKHvekaAsjWJ8R6WSONffD1gdhq4bg9qBG2OuiG3xTKKEbICiPZdq4ccezi+3kBbVrGTdq3+1QS9U1/CT06+zKuAOF2OAv3ZIvY/U8jHkfYiQghrnZwiNLxtTcg2PswxbAxT55HJoMjOJLP3uw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: sstabellini@xxxxxxxxxx, michal.orzel@xxxxxxx, xenia.ragiadakou@xxxxxxx, ayan.kumar.halder@xxxxxxx, consulting@xxxxxxxxxxx, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Paul Durrant <paul@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Thu, 10 Aug 2023 15:53:14 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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



 


Rackspace

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