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

Re: [XEN PATCH 1/4] x86: mechanically rename to address MISRA C:2012 Rule 5.3


  • To: Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 27 Jul 2023 16:50:56 +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=ai63f1VzzCVHjQDWUD/HzjE9IGoLvaWj1ZZrI+kBvFw=; b=VE5KMZTemE+TiEkGMiDM8aMse/7SAEj91xmL2pXFAJOPPNp6ee5jH7SdiS1Kmu45+PBi7da0m5We+vb4MMkAjFeCrWA3edzVoxEivOqXexa19E/aKy+UvOnrgYrmhdwLY9FpBWvL+BDdGMYVhcjRJ9uQg7kZWEyVQJy2rNbWxGr7qdOVBEhMorMtO8Ycox2AH2XcqsLLMjd7OF0VKhY63f2rLRpa62kjYGiQn+52fu68zm8dfQh6NuMJXnSIdFXJBG6w0987y+xV+iBPy7pbKcWb3yvwCe/XxFW5GExXfa/4GV9247qhuUEUICVgKsv8V9Rk/2JwmEkG1Ua3yZHbiQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ym8nT4bY6T2Z5dQii/h8MXC2Gns96u5G+oDaZmweXCEXi0DTdwucW/LWc/qhutRzO5/OoRLnHFFhcL1zBqzkcErnglHMrXySaGAN2NzA1dzQRGsF/IBpke6Af1SGm7ycIyjkcEiLincDN0Eh09Oov0ugv58eKCyOcarUS/5QQ0PVXq1sgSmuO102d4lKtcDVanLlJaLy5MGAvQZiT9OIAy/lYwRYzfu5JnCpYEz8+Wwf0G6R5WubO1JPPvKXYif3R8DILiDNuZZDL68ftOFeoxbQRHf/EvOQKt1Int9KdlWAy5cgGxJ2GnBvAxhe7h49Ur85Y6be+h3OJG0oavwlkw==
  • 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>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Thu, 27 Jul 2023 14:51:08 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 27.07.2023 12:47, Nicola Vetrini wrote:
> Rule 5.3 has the following headline:
> "An identifier declared in an inner scope shall not hide an
> identifier declared in an outer scope"
> 
> The renames done by this patch avoid shadowing from happening.
> They are as follows:
> - s/str/s/ in 'lapic_disable'
> - s/str/level/ in '(apic|mce)_set_verbosity'
> - s/str/state_str/ in 'mwait_idle_probe'
> - s/str/memmap_name/ in 'init_e820'

I'm sorry to say that, but I'm not willing to go and figure out where
that "str" is that there's supposedly a collision with. Please can you
state such right here, ...

> - s/i/j/ in 'mce_action' (the shadowing here is due to macro
>   'x86_mcinfo_lookup' that defines 'i' as a loop counter)

... much like you do in this case?

> - s/desc/descriptor/ in '_hvm_load_entry'
> - s/socket_info/sock_info/ in 'do_write_psr_msrs'

(I didn't look at any of these in any detail, partly because again
I hope for additional context before doing so.)

> - s/debug_stack_lines/dbg_stack_lines/ in 'compat_show_guest_stack'

This wants doing differently: The two functions originally lived in
different source files, so passing the static variable as argument
was preferred over making the variable non-static. When the function
was moved, that aspect was overlooked. The function argument simply
wants dropping.

Jan



 


Rackspace

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