On 06.07.2022 00:02, Xenia Ragiadakou wrote:
> Hi Julien,
> 
> On 7/6/22 00:38, Julien Grall wrote:
>> Hi Xenia,
>>
>> On 05/07/2022 22:02, Xenia Ragiadakou wrote:
>>> The function pv_console_evtchn() is defined in the header 
>>> <xen/pv_console.h>.
>>> If the header happens to be included by multiple files, this can 
>>> result in
>>> linker errors due to multiple definitions,
>>> So, it is more appropriate to resolve this MISRA C 2012 Rule 8.4 
>>> violation
>>> warning by making pv_console_evtchn() inline with internal linkage.
>>
>> There are multiple version of pv_console_evtchn(). The version below is 
>> only used when !CONFIG_XEN_GUEST.
>>
>> The header is also included multiple time within Xen. So I am a bit 
>> puzzled why we haven't seen this error before. Maybe this is unused when 
>> !CONFIG_XEN_GUEST?
>>
>> If yes, I would remove the call. If no, then I think the commit message 
>> should be clarified.
> 
> You are right. I had to clarify that this holds when !CONFIG_XEN_GUEST.
> So when !CONFIG_XEN_GUEST, the function pv_console_evtchn() is defined 
> inside the header file and the header is included only by a single file. 
> This is why the error has not been triggered.

Irrespective of that it is as Julien suspects: The function is only ever
referenced when XEN_GUEST. Hence the better course of action indeed looks
to be to ditch the unused stub; we don't even need DCE here for there to
not be any references.

Jan

Reply via email to