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

Re: [XEN PATCH 11/11] x86/mm: Add assertion to address MISRA C:2012 Rule 2.1


  • To: Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 3 Aug 2023 11:20:37 +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=tA1PdkAWBB6c0y72UrfcTIBqgkop7cNxizi7uWeUh6w=; b=R4r7Ubpbde8JAo4mxXescEVAVuJgrmPQbB+3uMjZmjMi4lQyrPvmOXwolPhl6S2EfrbxQLuh9DexSfc/RNBiKuBU3suE+LEJ2WxgIl5blakCTcjM9K8Pv6w/z+hUwDJ0U3ZiXA3GerWtjQR4vvSVfYC4ZrkKONWlxfFZKrDaYKXx0LoW56h2RO+ynms5o5FMks78XjqR8X5AJscuEEtekRiCW2jKRnelInXGcU+svCeCXm5eXWsRB6Rm7fkyMqomezka1HbXVL1ONxIxAmwsXjtxotir7zZtg0KNv5PJLrSvWkA0dZKGs5WMb8hWCgpn7Q4PYOtEl6fRFEGFbcuT/w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TJlx66OZkNQHDNQEHHKfhZow7njOA8UR1ijunZRTJmTw5dLxCXYu53CAXp/fQoZmpPN+Zw0Il+80AKJIoEtOnhaK78//kjyKsLFRKG98ncIOD9Q7HfLppKYdu/GF455bUtSQhnyK1hdcUFVdq6/paY6RwTLcVeALfYCAxkVkUyEbu4Or3oEZZ06Dun+DGWPiJiGgKiOJDt9oCczDD2+XcZPqjjR8v7KBxwCBgOJSaxOKFGsniocRqHvQkyYPvJY9aJOvFQDwP9mKOjNWbl9U+8hT02HXT0XUsDqFY4njUMSQ5EMJ5VWS+ESyjBBFQNf302DV88Y5YdZhc4TSbQcdtw==
  • 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>, George Dunlap <george.dunlap@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Thu, 03 Aug 2023 09:20:43 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 02.08.2023 16:38, Nicola Vetrini wrote:
> --- a/xen/arch/x86/mm.c
> +++ b/xen/arch/x86/mm.c
> @@ -4879,6 +4879,7 @@ long arch_memory_op(unsigned long cmd, 
> XEN_GUEST_HANDLE_PARAM(void) arg)
>          return subarch_memory_op(cmd, arg);
>      }
>  
> +    ASSERT_UNREACHABLE();
>      return 0;
>  }

I'd prefer to instead switch earlier "return 0" to "break".

> --- a/xen/arch/x86/mm/p2m-pod.c
> +++ b/xen/arch/x86/mm/p2m-pod.c
> @@ -1045,6 +1045,7 @@ p2m_pod_zero_check(struct p2m_domain *p2m, const gfn_t 
> *gfns, unsigned int count
>      }
>  
>      return;
> +    ASSERT_UNREACHABLE();
>  
>  out_unmap:
>      /*

In the description you say "before", but here you add something _after_
"return". What's the deal?

Jan



 


Rackspace

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