diff mbox series

[XEN] xen/keyhandler: address violations of MISRA C:2012 Rule 8.3 and drop bool_t

Message ID 7cb2183e6e387c04547b57b6f9f95c08bb613019.1690560051.git.federico.serafini@bugseng.com (mailing list archive)
State New, archived
Headers show
Series [XEN] xen/keyhandler: address violations of MISRA C:2012 Rule 8.3 and drop bool_t | expand

Commit Message

Federico Serafini July 28, 2023, 4:02 p.m. UTC
Change types in function declarations to be consistent with the
corresponding definitions.
This addresses violations of MISRA C:2012 Rule 8.3: "All declarations
of an object or function shall use the same names and type qualifiers".

No functional changes.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
---
 xen/common/keyhandler.c      | 8 ++++----
 xen/include/xen/keyhandler.h | 4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

Comments

Andrew Cooper July 28, 2023, 4:04 p.m. UTC | #1
On 28/07/2023 5:02 pm, Federico Serafini wrote:
> Change types in function declarations to be consistent with the
> corresponding definitions.
> This addresses violations of MISRA C:2012 Rule 8.3: "All declarations
> of an object or function shall use the same names and type qualifiers".
>
> No functional changes.
>
> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>

Always glad to see more bool_t disappearing.
Federico Serafini July 28, 2023, 4:13 p.m. UTC | #2
Hello Andrew,

On 28/07/23 18:04, Andrew Cooper wrote:
> On 28/07/2023 5:02 pm, Federico Serafini wrote:
>> Change types in function declarations to be consistent with the
>> corresponding definitions.
>> This addresses violations of MISRA C:2012 Rule 8.3: "All declarations
>> of an object or function shall use the same names and type qualifiers".
>>
>> No functional changes.
>>
>> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
> 
> Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
> 
> Always glad to see more bool_t disappearing.

in the message body I inverted 'definitions' with 'declarations',
please can you fix it?

Thanks
diff mbox series

Patch

diff --git a/xen/common/keyhandler.c b/xen/common/keyhandler.c
index 0a551033c4..68d8166968 100644
--- a/xen/common/keyhandler.c
+++ b/xen/common/keyhandler.c
@@ -101,8 +101,8 @@  void handle_keypress(unsigned char key, struct cpu_user_regs *regs)
     }
 }
 
-void register_keyhandler(unsigned char key, keyhandler_fn_t fn,
-                         const char *desc, bool_t diagnostic)
+void register_keyhandler(unsigned char key, keyhandler_fn_t *fn,
+                         const char *desc, bool diagnostic)
 {
     BUG_ON(key >= ARRAY_SIZE(key_table)); /* Key in range? */
     ASSERT(!key_table[key].fn);           /* Clobbering something else? */
@@ -113,8 +113,8 @@  void register_keyhandler(unsigned char key, keyhandler_fn_t fn,
     key_table[key].diagnostic = diagnostic;
 }
 
-void register_irq_keyhandler(unsigned char key, irq_keyhandler_fn_t fn,
-                             const char *desc, bool_t diagnostic)
+void register_irq_keyhandler(unsigned char key, irq_keyhandler_fn_t *fn,
+                             const char *desc, bool diagnostic)
 {
     BUG_ON(key >= ARRAY_SIZE(key_table)); /* Key in range? */
     ASSERT(!key_table[key].irq_fn);       /* Clobbering something else? */
diff --git a/xen/include/xen/keyhandler.h b/xen/include/xen/keyhandler.h
index 9c5830a037..5c6598af98 100644
--- a/xen/include/xen/keyhandler.h
+++ b/xen/include/xen/keyhandler.h
@@ -39,11 +39,11 @@  void initialize_keytable(void);
 void register_keyhandler(unsigned char key,
                          keyhandler_fn_t *fn,
                          const char *desc,
-                         bool_t diagnostic);
+                         bool diagnostic);
 void register_irq_keyhandler(unsigned char key,
                              irq_keyhandler_fn_t *fn,
                              const char *desc,
-                             bool_t diagnostic);
+                             bool diagnostic);
 
 /* Inject a keypress into the key-handling subsystem. */
 extern void handle_keypress(unsigned char key, struct cpu_user_regs *regs);