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

Re: [XEN PATCH v2] x86/mctelem: address violations of MISRA C: 2012 Rule 5.3



On 2024-07-01 10:27, Jan Beulich wrote:
On 27.06.2024 02:57, Stefano Stabellini wrote:
On Wed, 26 Jun 2024, Nicola Vetrini wrote:
From: Alessandro Zucchelli <alessandro.zucchelli@xxxxxxxxxxx>

This addresses violations of MISRA C:2012 Rule 5.3 which states as
following: An identifier declared in an inner scope shall not hide an
identifier declared in an outer scope.

In this case the gloabl variable being shadowed is the global static struct mctctl in this file, therefore the local variables are renamed to avoid this.

"global" and "static" contradict one another; I think you mean "file scope".

Yes.

While there (nit) also s/gloabl/global/ or perhaps even s/gloabl// to deal with the conflict with "static" also there (without writing "file scope"
twice).

No functional change.

Signed-off-by: Alessandro Zucchelli <alessandro.zucchelli@xxxxxxxxxxx>
Signed-off-by: Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx>

Nice one!

Reviewed-by: Stefano Stabellini <sstabellini@xxxxxxxxxx>

With the adjustment:
Acked-by: Jan Beulich <jbeulich@xxxxxxxx>

Jan

--
Nicola Vetrini, BSc
Software Engineer, BUGSENG srl (https://bugseng.com)



 


Rackspace

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