diff mbox series

[XEN] xen/emul-i8254: address a violation of MISRA C:2012 Rule 8.3

Message ID be245ab9b3805cdb1ba93695b95eeab24d432d6a.1695308350.git.federico.serafini@bugseng.com (mailing list archive)
State New, archived
Headers show
Series [XEN] xen/emul-i8254: address a violation of MISRA C:2012 Rule 8.3 | expand

Commit Message

Federico Serafini Sept. 21, 2023, 3:05 p.m. UTC
Make function declaration and definition consistent.
No fuctional change.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
---
 xen/arch/x86/emul-i8254.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jan Beulich Sept. 22, 2023, 8:29 a.m. UTC | #1
On 21.09.2023 17:05, Federico Serafini wrote:
> Make function declaration and definition consistent.
> No fuctional change.
> 
> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
> ---
>  xen/arch/x86/emul-i8254.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/xen/arch/x86/emul-i8254.c b/xen/arch/x86/emul-i8254.c
> index 41ec4a1ef1..c48a3606a2 100644
> --- a/xen/arch/x86/emul-i8254.c
> +++ b/xen/arch/x86/emul-i8254.c
> @@ -572,7 +572,7 @@ static uint32_t speaker_ioport_read(
>  }
>  
>  static int cf_check handle_speaker_io(
> -    int dir, unsigned int port, uint32_t bytes, uint32_t *val)
> +    int dir, unsigned int port, unsigned int bytes, uint32_t *val)
>  {
>      struct PITState *vpit = vcpu_vpit(current);
>  

While okay-ish, could I talk you into addressing the problem at its root,
by eliminating the two forward declarations? Afaict all it takes is to
move pit_init() down past the two functions it takes the address of. (Of
course at that point it may want considering whether to keep
pit_{,de}init() and pit_reset() close together.)

Jan
Federico Serafini Sept. 22, 2023, 12:14 p.m. UTC | #2
On 22/09/23 10:29, Jan Beulich wrote:
> On 21.09.2023 17:05, Federico Serafini wrote:
>> Make function declaration and definition consistent.
>> No fuctional change.
>>
>> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
>> ---
>>   xen/arch/x86/emul-i8254.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/xen/arch/x86/emul-i8254.c b/xen/arch/x86/emul-i8254.c
>> index 41ec4a1ef1..c48a3606a2 100644
>> --- a/xen/arch/x86/emul-i8254.c
>> +++ b/xen/arch/x86/emul-i8254.c
>> @@ -572,7 +572,7 @@ static uint32_t speaker_ioport_read(
>>   }
>>   
>>   static int cf_check handle_speaker_io(
>> -    int dir, unsigned int port, uint32_t bytes, uint32_t *val)
>> +    int dir, unsigned int port, unsigned int bytes, uint32_t *val)
>>   {
>>       struct PITState *vpit = vcpu_vpit(current);
>>   
> 
> While okay-ish, could I talk you into addressing the problem at its root,
> by eliminating the two forward declarations? Afaict all it takes is to
> move pit_init() down past the two functions it takes the address of. (Of
> course at that point it may want considering whether to keep
> pit_{,de}init() and pit_reset() close together.)
> 
> Jan
>

It seems to me a good alternative, I'll send a v2.
diff mbox series

Patch

diff --git a/xen/arch/x86/emul-i8254.c b/xen/arch/x86/emul-i8254.c
index 41ec4a1ef1..c48a3606a2 100644
--- a/xen/arch/x86/emul-i8254.c
+++ b/xen/arch/x86/emul-i8254.c
@@ -572,7 +572,7 @@  static uint32_t speaker_ioport_read(
 }
 
 static int cf_check handle_speaker_io(
-    int dir, unsigned int port, uint32_t bytes, uint32_t *val)
+    int dir, unsigned int port, unsigned int bytes, uint32_t *val)
 {
     struct PITState *vpit = vcpu_vpit(current);