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

Federico Serafini posted 1 patch 9 months, 2 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/7cb2183e6e387c04547b57b6f9f95c08bb613019.1690560051.git.federico.serafini@bugseng.com
xen/common/keyhandler.c      | 8 ++++----
xen/include/xen/keyhandler.h | 4 ++--
2 files changed, 6 insertions(+), 6 deletions(-)
[XEN PATCH] xen/keyhandler: address violations of MISRA C:2012 Rule 8.3 and drop bool_t
Posted by Federico Serafini 9 months, 2 weeks ago
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(-)

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);
-- 
2.34.1
Re: [XEN PATCH] xen/keyhandler: address violations of MISRA C:2012 Rule 8.3 and drop bool_t
Posted by Andrew Cooper 9 months, 2 weeks ago
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.
Re: [XEN PATCH] xen/keyhandler: address violations of MISRA C:2012 Rule 8.3 and drop bool_t
Posted by Federico Serafini 9 months, 2 weeks ago
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
-- 
Federico Serafini, M.Sc.

Software Engineer, BUGSENG (http://bugseng.com)