kernel-ark/arch/tile
Chen Gang 01f7ae0569 arch: tile: kernel: signal.c: Use __copy_from/to_user() instead of __get/put_user()
setup/restore_sigcontext() want to copy all related registers between
user and kernel. So use block copy instead of each registers copy. Then
can let code simple and clearer (which can avoid compiler's warning):

The related warning (with allmodconfig under tile):

    CC      arch/tile/kernel/signal.o
  In file included from include/linux/poll.h:11:0,
                   from include/linux/ring_buffer.h:7,
                   from include/linux/ftrace_event.h:5,
                   from include/trace/syscall.h:6,
                   from include/linux/syscalls.h:81,
                   from arch/tile/kernel/signal.c:30:
  arch/tile/kernel/signal.c: In function 'setup_sigcontext':
  arch/tile/kernel/signal.c:116:31: warning: iteration 53u invokes undefined behavior [-Waggressive-loop-optimizations]
     err |= __put_user(regs->regs[i], &sc->gregs[i]);
                                 ^
  ./arch/tile/include/asm/uaccess.h:236:26: note: in definition of macro '__put_user_asm'
          : "r" (ptr), "r" (x), "i" (-EFAULT))
                            ^
  ./arch/tile/include/asm/uaccess.h:297:10: note: in expansion of macro '__put_user_8'
    case 8: __put_user_8(x, ptr, __ret); break;   \
            ^
  arch/tile/kernel/signal.c:116:10: note: in expansion of macro '__put_user'
     err |= __put_user(regs->regs[i], &sc->gregs[i]);
            ^
  arch/tile/kernel/signal.c:115:2: note: containing loop
    for (i = 0; i < sizeof(struct pt_regs)/sizeof(long); ++i)
    ^

Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
2014-11-04 10:38:10 -05:00
..
configs tgt: defconfig cleanup 2014-07-17 22:07:44 +02:00
gxio tile gxio: use better string copy primitive 2014-10-02 10:19:34 -04:00
include Merge branch 'for-3.18-consistent-ops' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu 2014-10-15 07:48:18 +02:00
kernel arch: tile: kernel: signal.c: Use __copy_from/to_user() instead of __get/put_user() 2014-11-04 10:38:10 -05:00
kvm arch/tile/kvm: remove depends on CONFIG_EXPERIMENTAL 2013-01-17 12:11:26 -08:00
lib tile: include: asm: use 'long long' instead of 'u64' for atomic64_t and its related functions 2013-09-27 16:08:56 -04:00
mm Merge branch 'for-3.18-consistent-ops' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu 2014-10-15 07:48:18 +02:00
Kbuild
Kconfig tilegx: Enable ARCH_SUPPORTS_ATOMIC_RMW 2014-10-02 10:19:33 -04:00
Kconfig.debug tile: remove DEBUG_EXTRA_FLAGS kernel config option 2013-09-03 14:52:17 -04:00
Makefile tile: remove DEBUG_EXTRA_FLAGS kernel config option 2013-09-03 14:52:17 -04:00