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

Re: [XEN PATCH 03/13] xen/arm: address violations of MISRA C:2012 Directive 4.10


  • To: Simone Ballarin <simone.ballarin@xxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 30 Aug 2023 15:01:18 +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=ORh6UHbFyylwBxgrxl2XSlrHtK6ANhtlleg4+UdIcrM=; b=MgGFEiYwZhjdWT5Opw3DbtXCBF84N8bAC8YhXvA1aBFjjbXEejm9mO/PgrKLB/Vq0GHRoSx02aMSZkcWmkeCtEmXl4qZA2nLNwotCQCOVW3EjnXj1OeC3ls7lH/sSLe+hrJXCtsUUWOp7mCx2LLIXvzRAuRaI3VZJns1mVBv8ZyaiV0Zel/JxgKrehHxyjYQl8SC8lqbVQpaWJ3Ezp5XGqiI2AXUSu+sUOr5AWg5wQtgIBKoYW5iE/2NEIXJUmUfSl+o8X9YB1Vi134wm7xkIrBin0KkvmR7JT2AJCy52410iW6JuNLxkFyA+g3z8v8WfMsbsQn3XWxDxlgpLb9XXw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TByL2UJeLxcb2aSk3jSxnRDVts7gNAS8IiDJIGAbeBK5GanJLiAbu8yjSysWf8XPLhCN8Tcz5Gxa3SKLe9CozjojwzByeerYiWCAjSrwDSyy8yaIbkUJx6BTtnYNA0pQ4rOtDpwIEEZ5tj3SojEPL0UeFR4epVb/kaKDBo6L5kN6gwpVg1Y4wc7akYD7Y/g6KVP4iN0dC6SdYs4iv5C/KEkQvERFoFrOHB/rOsC/rm4aEVUPw+gQzVIFDCX7sdp39bjKs3bSvsbuEswQaY6GIlwG4U9u6PHiKDbQKDtlJMd59KWby85dDWkbfYjdWESCeKn5affLYFx19biShYd8vA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, consulting@xxxxxxxxxxx, sstabellini@xxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx, Julien Grall <julien.grall.oss@xxxxxxxxx>
  • Delivery-date: Wed, 30 Aug 2023 13:01:47 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 30.08.2023 14:53, Simone Ballarin wrote:
> On 29/08/23 00:10, Julien Grall wrote:
>> On Mon, 28 Aug 2023 at 09:20, Simone Ballarin <simone.ballarin@xxxxxxxxxxx>
>> wrote:
>>> --- a/xen/arch/arm/include/asm/hypercall.h
>>> +++ b/xen/arch/arm/include/asm/hypercall.h
>>> @@ -1,10 +1,10 @@
>>> +#ifndef __ASM_ARM_HYPERCALL_H__
>>> +#define __ASM_ARM_HYPERCALL_H__
>>> +
>>>   #ifndef __XEN_HYPERCALL_H__
>>>   #error "asm/hypercall.h should not be included directly - include
>>> xen/hypercall.h instead"
>>>   #endif
>>>
>>> -#ifndef __ASM_ARM_HYPERCALL_H__
>>> -#define __ASM_ARM_HYPERCALL_H__
>>> -
>>
>>
>> I understand that you are trying to fix a misra violation. However, this
>> feels like it was done on purpose.
>>
>> With the new change, you would not always check that the file were included
>> at the correct place. I am not against this change but this ought to be
>> explained.
> I don't think the semantics have changed. Please correct me if I'm wrong.
> 
> With this change, the only situation where the check is not performed is 
> when __ASM_ARM_HYPERCALL_H__ is defined (i.e. the file has already been 
> successfully included). This implies that if __ASM_ARM_HYPERCALL_H__ is 
> defined, then __XEN_HYPERCALL_H__ is also defined, so the check would be 
> useless.
> 
> The same thing happened with the code before the change: if I include 
> the file after xen/hypercall.h, the check will always succeed.

Hmm, I think you're right, but I draw a different conclusion: The check
fails to work as intended. And this can only be repaired without your
adjustment.

Jan



 


Rackspace

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