Skip to content

Commit

Permalink
m68knommu: fix sparse warnings in signal code
Browse files Browse the repository at this point in the history
Commit 858b810bf63f ("m68knommu: switch to using asm-generic/uaccess.h")
cleaned up a number of sparse warnings associated with lack of __user
annotations. It also uncovered a couple of more in the signal handling
code:

arch/m68k/kernel/signal.c:923:16:    expected char [noderef] __user *__x
arch/m68k/kernel/signal.c:923:16:    got void *
arch/m68k/kernel/signal.c:1007:16: warning: incorrect type in initializer (different address spaces)
arch/m68k/kernel/signal.c:1007:16:    expected char [noderef] __user *__x
arch/m68k/kernel/signal.c:1007:16:    got void *
arch/m68k/kernel/signal.c:1132:6: warning: symbol 'do_notify_resume' was not declared. Should it be static?

These are specific to a non-MMU configuration. Fix these inserting the
correct __user annotations as required.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>
  • Loading branch information
Greg Ungerer committed Oct 5, 2020
1 parent a27bc11 commit 0069674
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions arch/m68k/kernel/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -920,7 +920,8 @@ static int setup_frame(struct ksignal *ksig, sigset_t *set,
err |= __put_user(0x70004e40 + (__NR_sigreturn << 16),
(long __user *)(frame->retcode));
#else
err |= __put_user((void *) ret_from_user_signal, &frame->pretcode);
err |= __put_user((long) ret_from_user_signal,
(long __user *) &frame->pretcode);
#endif

if (err)
Expand Down Expand Up @@ -1004,7 +1005,8 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t *set,
err |= __put_user(0x4e40, (short __user *)(frame->retcode + 4));
#endif
#else
err |= __put_user((void *) ret_from_user_rt_signal, &frame->pretcode);
err |= __put_user((long) ret_from_user_rt_signal,
(long __user *) &frame->pretcode);
#endif /* CONFIG_MMU */

if (err)
Expand Down

0 comments on commit 0069674

Please sign in to comment.