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

Re: [PATCH 2/5] xen/common: vm_event: Fix MISRA C 2012 Rule 8.7 violation



Hi Jan,

On 6/27/22 10:11, Jan Beulich wrote:

On 26.06.2022 23:11, Xenia Ragiadakou wrote:
The function vm_event_wake() is referenced only in vm_event.c.
Change the linkage of the function from external to internal by adding
the storage-class specifier static to the function definition.

This patch aims to resolve indirectly a MISRA C 2012 Rule 8.4 violation warning.
Actually also for patch 1 - this is slightly confusing, as the title
talks about 8.7. At first I suspected a typo. May I suggest to add
"also" (which I think could be easily done while committing)?


This is actually a violation of MISRA C 2012 Rule 8.7 (Advisory), which states that functions referenced in only one translation unit should not be defined with external linkage. This violation triggers a MISRA C 2012 Rule 8.4 violation warning, because the function is defined with external linkage without a visible declaration at the point of definition.
I thought that this does not make it a violation of MISRA C 2012 Rule 8.4.

Signed-off-by: Xenia Ragiadakou <burzalodowa@xxxxxxxxx>
Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>




 


Rackspace

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