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

Re: [PATCH v2] arm/efi: address MISRA C Rule 11.3


  • To: Dmytro Prokopchuk1 <dmytro_prokopchuk1@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: "Orzel, Michal" <michal.orzel@xxxxxxx>
  • Date: Mon, 3 Nov 2025 09:52:21 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=epam.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=R0DTs4UoAYxbErh4CEudpK8CGNJ61G88ZLCtSiLE5zg=; b=aXwFYpRorBD6uz1ghiJFmtoes6n8j4o38jWzPK4dD+Nb7zp2WUWeZrg4M9oe0smq3V4frtkA5STgPiceSFe80ZRHPh5n1gSWf+Iivdrb0MIZf0doAsq84aJwjRne46JC0w7oeMxPx13rLaKwSDpU4vo90vL8eyhi7PDrcuW7iW2M9JB8Tg9BJfYSDBlkZUd3ap3/PnVuUKK2HL1JlaBmQvFlt4CdK7qnInpl/2z/+PIRP2hs4cZuH2EEUJquCZ6WH8xdFHJwts6f+kvBD4NWcD51wAw3J8Y7d76aDIJf14HRmEYs6DZOB9bCH3tOXXny/Tjl44p50lsx2rdmiYW2sw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=wy3PBHP/WVgrERplBKksNU+LmLNzbd1lkpI6AaIGgPGc8jdR9Zal0TbdLHk2GcEyamMtw3zvK9kUAgLYLSq9MWGId5rW0UJMNmGACUXKZs1MDndmGn0GV5DccIb4bDkHWX1Vs6/4jq5bTqPVZwcJJsU/bYcheAa+zSK8XCiT0Br8VjzXIW+YLVlQh20T8hZrRmWJJMtEVY1iQZn5hjkNlFXOHLEHfAui/siLYF1AWYo+XRCVY3rOSlxeHDvIScLjsXj1/A6aIBSxlUIuUQcULui0YnIzDZXquupgXlvYzuf6HIkHv7uMmN8VVY0hOn/rrwmJZCCe2HPwN+0AylJ3iw==
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, "Volodymyr Babchuk" <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Mon, 03 Nov 2025 08:52:47 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>


On 27/10/2025 22:12, Dmytro Prokopchuk1 wrote:
> MISRA C Rule 11.3 prohibits casting between pointer-to-object types that
> are different types. The original code used a macro 'NextMemoryDescriptor()'
> that performed a non-compliant cast from 'UINT8*' to 'EFI_MEMORY_DESCRIPTOR*'.
> 
> Change 'efi_process_memory_map_bootinfo()' function parameter from
> 'EFI_MEMORY_DESCRIPTOR *' to 'void *' for the memory map parameter. Replace
> usage of 'NextMemoryDescriptor()' macro with compliant pointer arithmetic
> on 'void *', followed by a single compliant cast to 'EFI_MEMORY_DESCRIPTOR *'.
> 
> Signed-off-by: Dmytro Prokopchuk <dmytro_prokopchuk1@xxxxxxxx>
Reviewed-by: Michal Orzel <michal.orzel@xxxxxxx>

~Michal




 


Rackspace

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