mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-16 09:56:46 +00:00
[S390] sparse: fix access past end of array warnings
Remove unnecessary code to avoid false positives from sparse, e.g. arch/s390/kernel/compat_signal.c:221:61: warning: invalid access past the end of 'set32' (8 8) Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
This commit is contained in:
parent
c8d1c0ff84
commit
399c1d8dbf
@ -362,12 +362,7 @@ asmlinkage long sys32_rt_sigprocmask(int how, compat_sigset_t __user *set,
|
||||
if (set) {
|
||||
if (copy_from_user (&s32, set, sizeof(compat_sigset_t)))
|
||||
return -EFAULT;
|
||||
switch (_NSIG_WORDS) {
|
||||
case 4: s.sig[3] = s32.sig[6] | (((long)s32.sig[7]) << 32);
|
||||
case 3: s.sig[2] = s32.sig[4] | (((long)s32.sig[5]) << 32);
|
||||
case 2: s.sig[1] = s32.sig[2] | (((long)s32.sig[3]) << 32);
|
||||
case 1: s.sig[0] = s32.sig[0] | (((long)s32.sig[1]) << 32);
|
||||
}
|
||||
s.sig[0] = s32.sig[0] | (((long)s32.sig[1]) << 32);
|
||||
}
|
||||
set_fs (KERNEL_DS);
|
||||
ret = sys_rt_sigprocmask(how,
|
||||
@ -377,12 +372,8 @@ asmlinkage long sys32_rt_sigprocmask(int how, compat_sigset_t __user *set,
|
||||
set_fs (old_fs);
|
||||
if (ret) return ret;
|
||||
if (oset) {
|
||||
switch (_NSIG_WORDS) {
|
||||
case 4: s32.sig[7] = (s.sig[3] >> 32); s32.sig[6] = s.sig[3];
|
||||
case 3: s32.sig[5] = (s.sig[2] >> 32); s32.sig[4] = s.sig[2];
|
||||
case 2: s32.sig[3] = (s.sig[1] >> 32); s32.sig[2] = s.sig[1];
|
||||
case 1: s32.sig[1] = (s.sig[0] >> 32); s32.sig[0] = s.sig[0];
|
||||
}
|
||||
s32.sig[1] = (s.sig[0] >> 32);
|
||||
s32.sig[0] = s.sig[0];
|
||||
if (copy_to_user (oset, &s32, sizeof(compat_sigset_t)))
|
||||
return -EFAULT;
|
||||
}
|
||||
@ -401,12 +392,8 @@ asmlinkage long sys32_rt_sigpending(compat_sigset_t __user *set,
|
||||
ret = sys_rt_sigpending((sigset_t __force __user *) &s, sigsetsize);
|
||||
set_fs (old_fs);
|
||||
if (!ret) {
|
||||
switch (_NSIG_WORDS) {
|
||||
case 4: s32.sig[7] = (s.sig[3] >> 32); s32.sig[6] = s.sig[3];
|
||||
case 3: s32.sig[5] = (s.sig[2] >> 32); s32.sig[4] = s.sig[2];
|
||||
case 2: s32.sig[3] = (s.sig[1] >> 32); s32.sig[2] = s.sig[1];
|
||||
case 1: s32.sig[1] = (s.sig[0] >> 32); s32.sig[0] = s.sig[0];
|
||||
}
|
||||
s32.sig[1] = (s.sig[0] >> 32);
|
||||
s32.sig[0] = s.sig[0];
|
||||
if (copy_to_user (set, &s32, sizeof(compat_sigset_t)))
|
||||
return -EFAULT;
|
||||
}
|
||||
|
@ -213,16 +213,8 @@ sys32_rt_sigaction(int sig, const struct sigaction32 __user *act,
|
||||
ret = get_user(sa_handler, &act->sa_handler);
|
||||
ret |= __copy_from_user(&set32, &act->sa_mask,
|
||||
sizeof(compat_sigset_t));
|
||||
switch (_NSIG_WORDS) {
|
||||
case 4: new_ka.sa.sa_mask.sig[3] = set32.sig[6]
|
||||
| (((long)set32.sig[7]) << 32);
|
||||
case 3: new_ka.sa.sa_mask.sig[2] = set32.sig[4]
|
||||
| (((long)set32.sig[5]) << 32);
|
||||
case 2: new_ka.sa.sa_mask.sig[1] = set32.sig[2]
|
||||
| (((long)set32.sig[3]) << 32);
|
||||
case 1: new_ka.sa.sa_mask.sig[0] = set32.sig[0]
|
||||
| (((long)set32.sig[1]) << 32);
|
||||
}
|
||||
new_ka.sa.sa_mask.sig[0] =
|
||||
set32.sig[0] | (((long)set32.sig[1]) << 32);
|
||||
ret |= __get_user(new_ka.sa.sa_flags, &act->sa_flags);
|
||||
|
||||
if (ret)
|
||||
@ -233,20 +225,8 @@ sys32_rt_sigaction(int sig, const struct sigaction32 __user *act,
|
||||
ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL);
|
||||
|
||||
if (!ret && oact) {
|
||||
switch (_NSIG_WORDS) {
|
||||
case 4:
|
||||
set32.sig[7] = (old_ka.sa.sa_mask.sig[3] >> 32);
|
||||
set32.sig[6] = old_ka.sa.sa_mask.sig[3];
|
||||
case 3:
|
||||
set32.sig[5] = (old_ka.sa.sa_mask.sig[2] >> 32);
|
||||
set32.sig[4] = old_ka.sa.sa_mask.sig[2];
|
||||
case 2:
|
||||
set32.sig[3] = (old_ka.sa.sa_mask.sig[1] >> 32);
|
||||
set32.sig[2] = old_ka.sa.sa_mask.sig[1];
|
||||
case 1:
|
||||
set32.sig[1] = (old_ka.sa.sa_mask.sig[0] >> 32);
|
||||
set32.sig[0] = old_ka.sa.sa_mask.sig[0];
|
||||
}
|
||||
set32.sig[1] = (old_ka.sa.sa_mask.sig[0] >> 32);
|
||||
set32.sig[0] = old_ka.sa.sa_mask.sig[0];
|
||||
ret = put_user((unsigned long)old_ka.sa.sa_handler, &oact->sa_handler);
|
||||
ret |= __copy_to_user(&oact->sa_mask, &set32,
|
||||
sizeof(compat_sigset_t));
|
||||
|
Loading…
x
Reference in New Issue
Block a user