diff mbox series

[XEN,07/10] arm/traps: address a violation of MISRA C:2012 Rule 8.2

Message ID dbc0e965cd9f93848d27e7ebf0ffcfca05499d58.1697207038.git.federico.serafini@bugseng.com (mailing list archive)
State New, archived
Headers show
Series arm: address some violations of MISRA C:2012 Rule 8.2 | expand

Commit Message

Federico Serafini Oct. 13, 2023, 3:24 p.m. UTC
Add missing parameter name, no functional change.

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

Comments

Stefano Stabellini Oct. 13, 2023, 11:19 p.m. UTC | #1
On Fri, 13 Oct 2023, Federico Serafini wrote:
> Add missing parameter name, no functional change.
> 
> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Julien Grall Oct. 16, 2023, 9:02 a.m. UTC | #2
Hi,

On 13/10/2023 16:24, Federico Serafini wrote:
> Add missing parameter name, no functional change.
> 
> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
> ---
>   xen/arch/arm/traps.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
> index ce89f16404..5aa14d4707 100644
> --- a/xen/arch/arm/traps.c
> +++ b/xen/arch/arm/traps.c
> @@ -1236,7 +1236,7 @@ int do_bug_frame(const struct cpu_user_regs *regs, vaddr_t pc)
>   
>       if ( id == BUGFRAME_run_fn )
>       {
> -        void (*fn)(const struct cpu_user_regs *) = (void *)regs->BUG_FN_REG;
> +        void (*fn)(const struct cpu_user_regs *regs) = (void *)regs->BUG_FN_REG;

Now the line will be over 80 characters. I think we should introduce a 
typedef. This would also help in the longer run to validate that the 
function passed to run_in_exception_handle() has the expected prototype.

Cheers,
Julien Grall Nov. 7, 2023, 5:57 p.m. UTC | #3
Hi Stefano,

On 16/10/2023 10:02, Julien Grall wrote:
> Hi,
> 
> On 13/10/2023 16:24, Federico Serafini wrote:
>> Add missing parameter name, no functional change.
>>
>> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
>> ---
>>   xen/arch/arm/traps.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
>> index ce89f16404..5aa14d4707 100644
>> --- a/xen/arch/arm/traps.c
>> +++ b/xen/arch/arm/traps.c
>> @@ -1236,7 +1236,7 @@ int do_bug_frame(const struct cpu_user_regs 
>> *regs, vaddr_t pc)
>>       if ( id == BUGFRAME_run_fn )
>>       {
>> -        void (*fn)(const struct cpu_user_regs *) = (void 
>> *)regs->BUG_FN_REG;
>> +        void (*fn)(const struct cpu_user_regs *regs) = (void 
>> *)regs->BUG_FN_REG;
> 
> Now the line will be over 80 characters. I think we should introduce a 
> typedef. This would also help in the longer run to validate that the 
> function passed to run_in_exception_handle() has the expected prototype.

I see this patch was committed in your for-4.19 branch. But this comment 
was unaddressed. Can you drop the patch because your branch is committed 
in staging?

Cheers,
Stefano Stabellini Nov. 7, 2023, 8:37 p.m. UTC | #4
On Tue, 7 Nov 2023, Julien Grall wrote:
> Hi Stefano,
> 
> On 16/10/2023 10:02, Julien Grall wrote:
> > Hi,
> > 
> > On 13/10/2023 16:24, Federico Serafini wrote:
> > > Add missing parameter name, no functional change.
> > > 
> > > Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
> > > ---
> > >   xen/arch/arm/traps.c | 2 +-
> > >   1 file changed, 1 insertion(+), 1 deletion(-)
> > > 
> > > diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
> > > index ce89f16404..5aa14d4707 100644
> > > --- a/xen/arch/arm/traps.c
> > > +++ b/xen/arch/arm/traps.c
> > > @@ -1236,7 +1236,7 @@ int do_bug_frame(const struct cpu_user_regs *regs,
> > > vaddr_t pc)
> > >       if ( id == BUGFRAME_run_fn )
> > >       {
> > > -        void (*fn)(const struct cpu_user_regs *) = (void
> > > *)regs->BUG_FN_REG;
> > > +        void (*fn)(const struct cpu_user_regs *regs) = (void
> > > *)regs->BUG_FN_REG;
> > 
> > Now the line will be over 80 characters. I think we should introduce a
> > typedef. This would also help in the longer run to validate that the
> > function passed to run_in_exception_handle() has the expected prototype.
> 
> I see this patch was committed in your for-4.19 branch. But this comment was
> unaddressed. Can you drop the patch because your branch is committed in
> staging?

I dropped the patch. Federico, please address Julien's feedback.
diff mbox series

Patch

diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index ce89f16404..5aa14d4707 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -1236,7 +1236,7 @@  int do_bug_frame(const struct cpu_user_regs *regs, vaddr_t pc)
 
     if ( id == BUGFRAME_run_fn )
     {
-        void (*fn)(const struct cpu_user_regs *) = (void *)regs->BUG_FN_REG;
+        void (*fn)(const struct cpu_user_regs *regs) = (void *)regs->BUG_FN_REG;
 
         fn(regs);
         return 0;