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

Re: [PATCH 4/9] ACPI: address violations of MISRA C:2012 Rule 11.8



On 14/12/23 17:36, Jan Beulich wrote:
On 14.12.2023 13:07, Simone Ballarin wrote:
--- a/xen/include/acpi/acmacros.h
+++ b/xen/include/acpi/acmacros.h
@@ -116,7 +116,7 @@
  #define ACPI_PTR_TO_PHYSADDR(i)         ACPI_TO_INTEGER(i)
#ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED
-#define ACPI_COMPARE_NAME(a,b)          (*ACPI_CAST_PTR (u32,(a)) == 
*ACPI_CAST_PTR (u32,(b)))
+#define ACPI_COMPARE_NAME(a,b)          (*ACPI_CAST_PTR (const u32,(a)) == 
*ACPI_CAST_PTR (const u32,(b)))

Hmm, I'm a little hesitant to take changes to this header. We've
inherited it from Linux, who in turn inherited / imported it from
ACPI CA.

  #else
  #define ACPI_COMPARE_NAME(a,b)          (!ACPI_STRNCMP (ACPI_CAST_PTR 
(char,(a)), ACPI_CAST_PTR (char,(b)), ACPI_NAME_SIZE))
  #endif

What about this alternative code, btw?

Jan

If the file is not supposed to be changed, I would consider adding it in
docs/misra/exclude-list*.
For the moment, I think it is better to drop the change.

--
Simone Ballarin, M.Sc.

Field Application Engineer, BUGSENG (https://bugseng.com)




 


Rackspace

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