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

[XEN PATCH v2 2/5] xen/delay: address MISRA C:2012 Rule 5.3.



The variable 'msec' declared in the macro shadows the local
variable in 'ehci_dbgp_bios_handoff', but to prevent any
future clashes with other functions the macro is converted to
a static inline function.

No functional change.

Signed-off-by: Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx>
---
Changes in v2:
- Switched to a static inline function, as suggested by Julien
---
 xen/include/xen/delay.h | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/xen/include/xen/delay.h b/xen/include/xen/delay.h
index 9d70ef035f..6ecee851f6 100644
--- a/xen/include/xen/delay.h
+++ b/xen/include/xen/delay.h
@@ -4,7 +4,12 @@
 /* Copyright (C) 1993 Linus Torvalds */
 
 #include <asm/delay.h>
-#define mdelay(n) (\
-       {unsigned long msec=(n); while (msec--) udelay(1000);})
+
+static inline void mdelay(unsigned long n)
+{
+    unsigned long msec=n;
+    while ( msec-- )
+        udelay(1000);
+}
 
 #endif /* defined(_LINUX_DELAY_H) */
-- 
2.34.1




 


Rackspace

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