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

[PATCH] xen/decompress: resolve MISRA R5.5 identifier/macro name conflicts


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Dmytro Prokopchuk1 <dmytro_prokopchuk1@xxxxxxxx>
  • Date: Thu, 21 May 2026 20:18:37 +0000
  • Accept-language: en-US, uk-UA, ru-RU
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none
  • 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=TfmyFn6PmUG0aFO2tfoAng6JltGb0x4H5SvYYBHyxQQ=; b=WxXWRvLPjUEFMwqLmGUU43knGFr8K74w80KKmh+i3SEmKCa3WZNQtvKlFnfK7gTFBu9W6Avsc55kgqismRiE3fQ1jF3nmRuRwoHMe/Xw2vL5NL4x4qdrSI6AVRJPFjBVAdK6cF+KZvhqBsVwNPHAePvTQfs4YGxnLsa+iNqmpCws6J79t9V3mTUL6/mBXAoN8R0T0fQJ5b//Xpnuz9l77n/2Mpe6dfw5AJ6n2x77/OTcDaYNAByiCE4pHpRWq9Z8rPX4d8xBRIG9RqjFY9MYamTM4SqZdvV7p5MI26lk2BK08eEiW+9Ci3dVYbF6joiE0oz0l/uc7i7THwrNG8pXkg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=GvA71mX+s4y4gopJoSIC6LqBJfuMbTLgdh8oM+1Z+gL3GkmR/nmPlG8mX8HWp3IvgbVXwvHq402yK5miQDqvqAO8KhWXCEWfANjyaCDZM8O3PXPk3SwY53A/x0JpEvzT+tZr0e82JTOCxWh23AxIU+JR1SwhIcNN6ZtXDjWoJPOFs/EumDDnMWPVYm+ewdmkpXH2XtpbBChPdXvJmNjB4b6cGAJIeqd0zEgEm+eaZleakABnT8eye3plc6TBD4V7F4ed/8NwxS/lYhaS8YeTMOMA/Mq2aCvh5FD/3MTzqaZP6LpnNGNhVAC9LIvQxH0U50DNrX1LSR9n7nl6f55dPA==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=epam.com header.i="@epam.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck"
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com;
  • Cc: Dmytro Prokopchuk1 <dmytro_prokopchuk1@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • Delivery-date: Thu, 21 May 2026 20:18:58 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHc6V8B/lHbglNK/EOVvgWJnFkvvQ==
  • Thread-topic: [PATCH] xen/decompress: resolve MISRA R5.5 identifier/macro name conflicts

Convert 'malloc' and 'free' macros in 'decompress.h' from object-like
to function-like form.

The object-like macros '#define free xfree' perform unconditional text
replacement, causing conflicts with struct field 'free' in 'page_info'
unions. Function-like macros only match when followed by parentheses,
allowing 'free' to be used both as a macro and as a struct field without
conflicts.

Applying function-like form to both 'malloc' and 'free' ensures consistent
macro style.

Signed-off-by: Dmytro Prokopchuk <dmytro_prokopchuk1@xxxxxxxx>
---
 xen/common/decompress.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/common/decompress.h b/xen/common/decompress.h
index 034c833665..df9fb9234f 100644
--- a/xen/common/decompress.h
+++ b/xen/common/decompress.h
@@ -9,8 +9,8 @@
 #include <xen/types.h>
 #include <xen/xmalloc.h>
 
-#define malloc xmalloc_bytes
-#define free xfree
+#define malloc(a) xmalloc_bytes(a)
+#define free(a) xfree(a)
 
 #define large_malloc xmalloc_bytes
 #define large_free xfree
-- 
2.43.0



 


Rackspace

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