lkml.org 
[lkml]   [2020]   [Apr]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v3 13/16] powerpc/watchpoint: Prepare handler to handle more than one watcnhpoint
From
Date
Hi Christophe,

>> @@ -101,14 +129,20 @@ static bool is_ptrace_bp(struct perf_event *bp)
>>    */
>>   void arch_unregister_hw_breakpoint(struct perf_event *bp)
>>   {
>> +    int i;
>> +
>
> This declaration should be in the block using it.
>
>>       /*
>>        * If the breakpoint is unregistered between a hw_breakpoint_handler()
>>        * and the single_step_dabr_instruction(), then cleanup the breakpoint
>>        * restoration variables to prevent dangling pointers.
>>        * FIXME, this should not be using bp->ctx at all! Sayeth peterz.
>>        */
>> -    if (bp->ctx && bp->ctx->task && bp->ctx->task != ((void *)-1L))
>> -        bp->ctx->task->thread.last_hit_ubp = NULL;
>> +    if (bp->ctx && bp->ctx->task && bp->ctx->task != ((void *)-1L)) {
>
> Add declaration of 'int i' here.

How will that help? Keeping declaration at the start of function is also
common practice and I don't see any recommendation to move them inside
conditional block.

Thanks,
Ravi

\
 
 \ /
  Last update: 2020-04-24 05:43    [W:0.069 / U:0.132 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site