[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: Jan Beulich <jbeulich@xxxxxxxx>, Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Thu, 27 Jul 2023 16:00:09 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.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=aQcYL0+3nv9q3I6i1DSxYcispTEsFXUpuUha5WTQ3Nc=; b=VIujeSr4xSkrDTLUzj/UcCHEMrgXLb2xJVAyn+1QPjb991TyTpVo/xOEGNtmbTX1PViuEHJSxWu61+5WkzRPMp+FSVYs+SmRogHgBQ9CbLwqoygMzUF+vn/krmqPi7ja6sPJ/S0inKIk2VgpydXh42ZO7I+okRe7uJvV8iaOLcysaI2LNl1VpmiSA7uGZ3/STGF1QvTXSKsp+nYqR9XUObUc0pxaPXpdPa/lKgLTq3eKdn7h6iStOkQGBz/K6ozVnokln9mXISuX8AO0lt5q/iHDwf/6YC/tiXHIyXoUHvO5Avg5BbyR9bdEM6RLJm18aRA8SoOOnfsvepJ4zyHdtw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JCeUF54if/TqhqKzWTpS/iGrV76Z7xCE7eru0KIe3ZttdYVO4cQuYIVdT0PLobwwNcA1X1RHOSJXUjpiIHHZhV68pXCkDvJ/aSfJsCUHE+Mhe10kD4JBPLFDyf7JXjnR13E5a1ni/ozv6b7gx8HINXesl5fn5ORArHsKCgB/DGXuYVt+iuS4nQ6+TpE5T6CVUVwc2fNa618fSDKdS715jwvlRKHbUht2IXCTzR2QcvBZEpVQWaV2PU0vrZjWfb1WxLRsHolR5ik2pEoIpUxq70uWRL98kfSCRymuyr1XIGBPU5K00fP79FZLCnhJUfFS5NA4+yHOWyWt5Wfh7e2BPA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: sstabellini@xxxxxxxxxx, michal.orzel@xxxxxxx, xenia.ragiadakou@xxxxxxx, ayan.kumar.halder@xxxxxxx, consulting@xxxxxxxxxxx, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Thu, 27 Jul 2023 15:00:51 +0000
  • Ironport-data: A9a23:ZwDZi65zJGH2vh1gz5ydTAxRtIPGchMFZxGqfqrLsTDasY5as4F+v mpNCm+HaP/bMGqmKIhwYY3kp0kEv8SGmIIyTAZlriEyHi5G8cbLO4+Ufxz6V8+wwm8vb2o8t plDNYOQRCwQZiWBzvt4GuG59RGQ7YnRGvynTraCYnsrLeNdYH9JoQp5nOIkiZJfj9G8Agec0 fv/uMSaM1K+s9JOGjt8B5mr9lU35ZwehBtC5gZlPa8R4weE/5UoJMl3yZ+ZfiOQrrZ8RoZWd 86bpJml82XQ+QsaC9/Nut4XpWVTH9Y+lSDX4pZnc/DKbipq/0Te4Y5iXBYoUm9Fii3hojxE4 I4lWapc6+seFvakdOw1C3G0GszlVEFM0OevzXOX6aR/w6BaGpdFLjoH4EweZOUlFuhL7W5ms qYaKDQ9fhy5rsGT5ZyFQ8Q1xcciI5y+VG8fkikIITDxK98DGMqGZpqQoNhS0XE3m9xEGuvYa 4wBcz1zYR/cYhpJfFAKFJY5m+TujX76G9FagAvN+exrvC6Nkkotj9ABM/KMEjCObexTklyVu STt+GPhDwtBHNee1SCE4jSngeqncSbTAdtMReHppqc36LGV7m4jGkMranW6mPq4tlG/ef0BB Egq+gN7+MDe82TuFLERRSaQonSJoxodUNp4CPAh5UeGza+8ywCYDW8AR3hfZcA8tck3bTY32 USEmdyvDjtq2JWOUm6U/LqQqTK0OAAWIHUEaCtCShEKi/HmoYozhxaJScxxHaqdh9j5Xzr3x liivCU4hrxVl8cE1qy39FPAnhqlo5SPRQkwji3eT2ujqABkYYe/IYyh7VTW995JKYrfRV6E1 FAPnM6F8eQSDJeCvCaQT/4AGr7v7PGAWBXDhXZ/Ep9n8C6ik1azcIYV7DxgKUNBNscfZSSvc ELVoRlW5pJYID2td6AfXm6qI8EjzKylEMu/UPnRN4BKesIpKFDB+zxyb0mN2WyriFIrjaw0J Zacd4CrEGoeDqNkijGxQo/xzIMW+8z3/kuLLbiT8vht+ef2iKK9IVvdDGazUw==
  • Ironport-hdrordr: A9a23:74gBXqlL57fmSD234Bl9lShdoCDpDfKB3DAbv31ZSRFFG/FwWf rOoB19726TtN9xYgBGpTnkAsO9qBznmKKdjbN8AV7mZniEhINHRLsSkbcKgAeQZhEXz4ZmpN hdmtFFeaPN5DpB7foSkTPId+rIm+P3iZxA7N22pxxQpENRGsNdBmFCZTpzeXcGITWua6BWKH O03Ls3mxOQPVoWc+WmDT0/U+DYodqjruOdXTc2QzAm9SiThneS5LT7ChiV2Qp2aUI1/Z4StU bEji3k7eGZv/u60x/R0HKWx5lag9f60LJ4db+xo/lQBDXwqxqiIL5sXLCPp1kO0ZmSwVsnis TNpB88P8J18RrqDxGInSc=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 27/07/2023 3:50 pm, Jan Beulich wrote:
> 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?

In fairness to Nicola, that was given.

> Signed-off-by: Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx>
> ---
> Function 'str' in 'xen/arch/x86/include/asm/desc.h'
> causes the shadowing.

which is the wrapper for the STR instruction.

It's used in a single assertion, and I'd be happy getting rid of it
entirely.  Alternatively, it could be renamed to read_tr() (or
read_tr_sel() ?) if we want to keep the assertion.

We're not renaming every other use of 'str' to mean string just for this...

~Andrew



 


Rackspace

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