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

[XEN PATCH 3/5] x86/irq: address violation of MISRA C Rule 5.5


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Dmytro Prokopchuk1 <dmytro_prokopchuk1@xxxxxxxx>
  • Date: Fri, 4 Jul 2025 20:39:38 +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=Zvriup+5D2WBdsWjxZrf1fWKGFJvH+SHsOGJOGyvEEo=; b=rB7/PlNxGLKNZvdhM5ir72BXi7WEdSl6Dv1Y09sbRANBNSzSt5E06aH38cKr2Vg9EoUJD8qPj9U6t0X4QzOHpoThqToSAKMHP5KsG57tZtCyRPHi2srn+p2uxP0BvyRSV6ZKXfeeMIpZxdaQFHTwYYap5F/R2Cnoc8Xw48xYlo7uPro/8/q8l8LEihK1duZ8i7cwUST8QVaZvyHhUKM+TNGshx3+TZ9Cy2q9qxrKSFh/C9D4k9/KgLbGcpO74AoWtKVxZGmJxsejRGq+a3RB1ZlVxjMR0j9Y7XWD9G/9p0F7vD7PufKcbJHOUDPrBlcJ0gSzTYymRjtDhu+7w9Kfgw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=EqtahM5i7KK1CkiJv8WLM2efR8zcNb+/7NGN+VhmSJlpgyl2le7jIGefoDuPjJwhok3PvWkBVajOMbQLFyI/f2LQOBWF/SscPLpLS0RJeSp9dluT84ttn1eb4iFgcV7AvxVfW22QtwljqRQfQvmBmoDxCZfk5BttgYpp+KhpQL/fK7tW/yXFfDuR5vEM7vAymqZ4Xy3vsl5ljV5ATDd5vSHqRV/8o16kXAsi//hvD6S2yncGLx3viVbOiuvnpQupXGjd2ga1kOUgG6OsfXgmX/QqfRpWCqtlmRYS6LQsGg4/p44lEPCYYdI+YF5oCwi3qmuuMTgxNdrirRfyXts/fQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com;
  • Cc: Dmytro Prokopchuk1 <dmytro_prokopchuk1@xxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • Delivery-date: Fri, 04 Jul 2025 20:39:48 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHb7SPCcQgXyJtRukKOfLrFemIDFA==
  • Thread-topic: [XEN PATCH 3/5] x86/irq: address violation of MISRA C Rule 5.5

Address a violation of MISRA C:2012 Rule 5.5:
"Identifiers shall be distinct from macro names".

Reports for service MC3A2.R5.5:
xen/include/xen/irq.h: non-compliant function `pirq_cleanup_check(struct pirq*, 
struct domain*)'
xen/include/xen/irq.h: non-compliant macro `pirq_cleanup_check'

The primary issue stems from the macro and function
having identical names, which is confusing and
non-compliant with common coding standards.

Change the function name by adding two underscores at the end.

Signed-off-by: Dmytro Prokopchuk <dmytro_prokopchuk1@xxxxxxxx>
---
 xen/arch/x86/irq.c    | 2 +-
 xen/include/xen/irq.h | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index 556134f85a..d61720aa60 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -1383,7 +1383,7 @@ struct pirq *alloc_pirq_struct(struct domain *d)
     return pirq;
 }
 
-void (pirq_cleanup_check)(struct pirq *pirq, struct domain *d)
+void pirq_cleanup_check__(struct pirq *pirq, struct domain *d)
 {
     /*
      * Check whether all fields have their default values, and delete
diff --git a/xen/include/xen/irq.h b/xen/include/xen/irq.h
index 95034c0d6b..02f686a999 100644
--- a/xen/include/xen/irq.h
+++ b/xen/include/xen/irq.h
@@ -183,10 +183,10 @@ extern struct pirq *pirq_get_info(struct domain *d, int 
pirq);
 #define pirq_to_evtchn(d, pirq) pirq_field(d, pirq, evtchn, 0)
 #define pirq_masked(d, pirq) pirq_field(d, pirq, masked, 0)
 
-void pirq_cleanup_check(struct pirq *pirq, struct domain *d);
+void pirq_cleanup_check__(struct pirq *pirq, struct domain *d);
 
 #define pirq_cleanup_check(pirq, d) \
-    (!(pirq)->evtchn ? pirq_cleanup_check(pirq, d) : (void)0)
+    (!(pirq)->evtchn ? pirq_cleanup_check__(pirq, d) : (void)0)
 
 extern void pirq_guest_eoi(struct pirq *pirq);
 extern void desc_guest_eoi(struct irq_desc *desc, struct pirq *pirq);
-- 
2.43.0



 


Rackspace

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