Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit a5c1cb63 authored by Chen Gang's avatar Chen Gang Committed by Chris Metcalf
Browse files

arch: tile: kernel: kgdb.c: Use memcpy() instead of pointer copy one by one



Not only memcpy() is faster than pointer copy, but also let code more
clearer and simple, which can avoid compiling warning (the original
implementation copy registers by exceeding member array border).

The related warning (with allmodconfig under tile):

    CC      arch/tile/kernel/kgdb.o
  arch/tile/kernel/kgdb.c: In function 'sleeping_thread_to_gdb_regs':
  arch/tile/kernel/kgdb.c:140:31: warning: iteration 53u invokes undefined behavior [-Waggressive-loop-optimizations]
     *(ptr++) = thread_regs->regs[reg];
                                 ^
  arch/tile/kernel/kgdb.c:139:2: note: containing loop
    for (reg = 0; reg <= TREG_LAST_GPR; reg++)
    ^

Signed-off-by: default avatarChen Gang <gang.chen.5i5j@gmail.com>
Signed-off-by: default avatarChris Metcalf <cmetcalf@ezchip.com>
parent f4743673
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment