From patchwork Wed Apr 23 13:11:55 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 28888 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f70.google.com (mail-oa0-f70.google.com [209.85.219.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5EB7620534 for ; Wed, 23 Apr 2014 13:17:36 +0000 (UTC) Received: by mail-oa0-f70.google.com with SMTP id m1sf5442002oag.1 for ; Wed, 23 Apr 2014 06:17:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:date :message-id:in-reply-to:references:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=10+vyPgkNiD3GmLxIBtrJTgfo0XkDo0y05F8siruvZU=; b=J41OOgBWgrhZt3OEB/85YI4mkj1OAy5zy7cqs5kjxv66zz6jU1ItdUkgrhMFoF63Pd IYalMNK8mxSj4EAvsyNHiW4TqHqlTe8zLQY42pzzAFAF5VfAoI00xPlXrhgEGS12imiR pIGp0TTrBG3eWDVvtnFxNkNEJV04qjvy/dgJw6WeDY/auB1EU5L1wF0SBa+kIH6GF/vc xwoeSg/SLO7/R6MJCXIWmu0sWAv2l7u2weDSXGvx5PwhU1Rlj18jE8/F60JrbHSpu15G P1RnGrfPSMI1/w2ZL7v+qtzG1Ex68pMewMz82ZyqSq2xz60YLOpffU/TgrHhmh8ETgOH agTw== X-Gm-Message-State: ALoCoQkkviH8RT+L3V32XfQY9Dl7ezjc+zPRU0hiXEMKL3lfSXi4lRTgr4i7RPeyBTDO/1159gOu X-Received: by 10.182.128.166 with SMTP id np6mr10447983obb.16.1398259055768; Wed, 23 Apr 2014 06:17:35 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.19.239 with SMTP id 102ls608813qgh.42.gmail; Wed, 23 Apr 2014 06:17:35 -0700 (PDT) X-Received: by 10.52.119.178 with SMTP id kv18mr366640vdb.39.1398259055524; Wed, 23 Apr 2014 06:17:35 -0700 (PDT) Received: from mail-vc0-f174.google.com (mail-vc0-f174.google.com [209.85.220.174]) by mx.google.com with ESMTPS id ys15si161207vcb.70.2014.04.23.06.17.35 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 23 Apr 2014 06:17:35 -0700 (PDT) Received-SPF: none (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) client-ip=209.85.220.174; Received: by mail-vc0-f174.google.com with SMTP id ld13so1090478vcb.33 for ; Wed, 23 Apr 2014 06:17:35 -0700 (PDT) X-Received: by 10.52.130.225 with SMTP id oh1mr35952445vdb.8.1398259055415; Wed, 23 Apr 2014 06:17:35 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp103279vcb; Wed, 23 Apr 2014 06:17:34 -0700 (PDT) X-Received: by 10.140.47.206 with SMTP id m72mr49756056qga.21.1398259053772; Wed, 23 Apr 2014 06:17:33 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id c4si426645qad.118.2014.04.23.06.17.33 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 23 Apr 2014 06:17:33 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:60921 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wcx3M-0005ab-Hg for patch@linaro.org; Wed, 23 Apr 2014 09:17:32 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50072) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WcwyF-0001ky-VK for qemu-devel@nongnu.org; Wed, 23 Apr 2014 09:12:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wcwy7-0001IX-UH for qemu-devel@nongnu.org; Wed, 23 Apr 2014 09:12:15 -0400 Received: from afflict.kos.to ([92.243.29.197]:42797) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wcwy7-0001I4-It for qemu-devel@nongnu.org; Wed, 23 Apr 2014 09:12:07 -0400 Received: from localhost.localdomain (afflict [92.243.29.197]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by afflict.kos.to (Postfix) with ESMTPSA id D88CA264D2 for ; Wed, 23 Apr 2014 15:12:05 +0200 (CEST) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Wed, 23 Apr 2014 16:11:55 +0300 Message-Id: X-Mailer: git-send-email 1.7.2.5 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 92.243.29.197 Subject: [Qemu-devel] [PATCH 04/13] signal.c: remove return value from setup_sigcontext X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: riku.voipio@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Riku Voipio Make all implementations of setup_sigcontext void and remove checking it's return value from functions calling setup_sigcontext. Signed-off-by: Riku Voipio --- linux-user/signal.c | 65 +++++++++++++++++------------------------------------ 1 file changed, 21 insertions(+), 44 deletions(-) diff --git a/linux-user/signal.c b/linux-user/signal.c index 4da9c26..6427e6e 100644 --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -836,12 +836,11 @@ struct rt_sigframe */ /* XXX: save x87 state */ -static int -setup_sigcontext(struct target_sigcontext *sc, struct target_fpstate *fpstate, - CPUX86State *env, abi_ulong mask, abi_ulong fpstate_addr) +static void setup_sigcontext(struct target_sigcontext *sc, + struct target_fpstate *fpstate, CPUX86State *env, abi_ulong mask, + abi_ulong fpstate_addr) { CPUState *cs = CPU(x86_env_get_cpu(env)); - int err = 0; uint16_t magic; /* already locked in setup_frame() */ @@ -874,7 +873,6 @@ setup_sigcontext(struct target_sigcontext *sc, struct target_fpstate *fpstate, /* non-iBCS2 extensions.. */ __put_user(mask, &sc->oldmask); __put_user(env->cr[2], &sc->cr2); - return err; } /* @@ -994,9 +992,9 @@ static void setup_rt_frame(int sig, struct target_sigaction *ka, &frame->uc.tuc_stack.ss_flags); __put_user(target_sigaltstack_used.ss_size, &frame->uc.tuc_stack.ss_size); - err |= setup_sigcontext(&frame->uc.tuc_mcontext, &frame->fpstate, - env, set->sig[0], - frame_addr + offsetof(struct rt_sigframe, fpstate)); + setup_sigcontext(&frame->uc.tuc_mcontext, &frame->fpstate, env, + set->sig[0], frame_addr + offsetof(struct rt_sigframe, fpstate)); + for(i = 0; i < TARGET_NSIG_WORDS; i++) { if (__put_user(set->sig[i], &frame->uc.tuc_sigmask.sig[i])) goto give_sigsegv; @@ -2856,10 +2854,9 @@ static inline int install_sigtramp(unsigned int *tramp, unsigned int syscall) return err; } -static inline int -setup_sigcontext(CPUMIPSState *regs, struct target_sigcontext *sc) +static inline void setup_sigcontext(CPUMIPSState *regs, + struct target_sigcontext *sc) { - int err = 0; int i; __put_user(exception_resume_pc(regs), &sc->sc_pc); @@ -2891,8 +2888,6 @@ setup_sigcontext(CPUMIPSState *regs, struct target_sigcontext *sc) for (i = 0; i < 32; ++i) { __put_user(regs->active_fpu.fpr[i].d, &sc->sc_fpregs[i]); } - - return err; } static inline int @@ -2979,8 +2974,7 @@ static void setup_frame(int sig, struct target_sigaction * ka, install_sigtramp(frame->sf_code, TARGET_NR_sigreturn); - if(setup_sigcontext(regs, &frame->sf_sc)) - goto give_sigsegv; + setup_sigcontext(regs, &frame->sf_sc); for(i = 0; i < TARGET_NSIG_WORDS; i++) { if(__put_user(set->sig[i], &frame->sf_mask.sig[i])) @@ -3227,10 +3221,9 @@ static abi_ulong get_sigframe(struct target_sigaction *ka, return (sp - frame_size) & -8ul; } -static int setup_sigcontext(struct target_sigcontext *sc, +static void setup_sigcontext(struct target_sigcontext *sc, CPUSH4State *regs, unsigned long mask) { - int err = 0; int i; #define COPY(x) __put_user(regs->x, &sc->sc_##x) @@ -3255,8 +3248,6 @@ static int setup_sigcontext(struct target_sigcontext *sc, /* non-iBCS2 extensions.. */ __put_user(mask, &sc->oldmask); - - return err; } static int restore_sigcontext(CPUSH4State *regs, struct target_sigcontext *sc, @@ -3305,7 +3296,7 @@ static void setup_frame(int sig, struct target_sigaction *ka, signal = current_exec_domain_sig(sig); - err |= setup_sigcontext(&frame->sc, regs, set->sig[0]); + setup_sigcontext(&frame->sc, regs, set->sig[0]); for (i = 0; i < TARGET_NSIG_WORDS - 1; i++) { __put_user(set->sig[i + 1], &frame->extramask[i]); @@ -3955,11 +3946,10 @@ badframe: /* Set up a signal frame. */ -static int setup_sigcontext(struct target_sigcontext *sc, +static void setup_sigcontext(struct target_sigcontext *sc, CPUOpenRISCState *regs, unsigned long mask) { - int err = 0; unsigned long usp = regs->gpr[1]; /* copy the regs. they are first in sc so we can use sc directly */ @@ -3973,7 +3963,7 @@ static int setup_sigcontext(struct target_sigcontext *sc, /* then some other stuff */ __put_user(mask, &sc->oldmask); - __put_user(usp, &sc->usp); return err; + __put_user(usp, &sc->usp); } static inline unsigned long align_sigframe(unsigned long sp) @@ -4048,14 +4038,10 @@ static void setup_rt_frame(int sig, struct target_sigaction *ka, __put_user(sas_ss_flags(env->gpr[1]), &frame->uc.tuc_stack.ss_flags); __put_user(target_sigaltstack_used.ss_size, &frame->uc.tuc_stack.ss_size); - err |= setup_sigcontext(&frame->sc, env, set->sig[0]); + setup_sigcontext(&frame->sc, env, set->sig[0]); /*err |= copy_to_user(frame->uc.tuc_sigmask, set, sizeof(*set));*/ - if (err) { - goto give_sigsegv; - } - /* trampoline - the desired return ip is the retcode itself */ return_ip = (unsigned long)&frame->retcode; /* This is l.ori r11,r0,__NR_sigreturn, l.sys 1 */ @@ -5088,12 +5074,9 @@ struct target_rt_sigframe struct target_ucontext uc; }; -static int -setup_sigcontext(struct target_sigcontext *sc, CPUM68KState *env, - abi_ulong mask) +static void setup_sigcontext(struct target_sigcontext *sc, CPUM68KState *env, + abi_ulong mask) { - int err = 0; - __put_user(mask, &sc->sc_mask); __put_user(env->aregs[7], &sc->sc_usp); __put_user(env->dregs[0], &sc->sc_d0); @@ -5102,8 +5085,6 @@ setup_sigcontext(struct target_sigcontext *sc, CPUM68KState *env, __put_user(env->aregs[1], &sc->sc_a1); __put_user(env->sr, &sc->sc_sr); __put_user(env->pc, &sc->sc_pc); - - return err; } static int @@ -5163,9 +5144,7 @@ static void setup_frame(int sig, struct target_sigaction *ka, sc_addr = frame_addr + offsetof(struct target_sigframe, sc); __put_user(sc_addr, &frame->psc); - err |= setup_sigcontext(&frame->sc, env, set->sig[0]); - if (err) - goto give_sigsegv; + setup_sigcontext(&frame->sc, env, set->sig[0]); for(i = 1; i < TARGET_NSIG_WORDS; i++) { if (__put_user(set->sig[i], &frame->extramask[i - 1])) @@ -5458,10 +5437,10 @@ struct target_rt_sigframe { #define INSN_LDI_R0 0x201f0000 #define INSN_CALLSYS 0x00000083 -static int setup_sigcontext(struct target_sigcontext *sc, CPUAlphaState *env, +static void setup_sigcontext(struct target_sigcontext *sc, CPUAlphaState *env, abi_ulong frame_addr, target_sigset_t *set) { - int i, err = 0; + int i; __put_user(on_sig_stack(frame_addr), &sc->sc_onstack); __put_user(set->sig[0], &sc->sc_mask); @@ -5482,8 +5461,6 @@ static int setup_sigcontext(struct target_sigcontext *sc, CPUAlphaState *env, __put_user(0, &sc->sc_traparg_a0); /* FIXME */ __put_user(0, &sc->sc_traparg_a1); /* FIXME */ __put_user(0, &sc->sc_traparg_a2); /* FIXME */ - - return err; } static int restore_sigcontext(CPUAlphaState *env, @@ -5532,7 +5509,7 @@ static void setup_frame(int sig, struct target_sigaction *ka, goto give_sigsegv; } - err |= setup_sigcontext(&frame->sc, env, frame_addr, set); + setup_sigcontext(&frame->sc, env, frame_addr, set); if (ka->sa_restorer) { r26 = ka->sa_restorer; @@ -5587,7 +5564,7 @@ static void setup_rt_frame(int sig, struct target_sigaction *ka, &frame->uc.tuc_stack.ss_flags); __put_user(target_sigaltstack_used.ss_size, &frame->uc.tuc_stack.ss_size); - err |= setup_sigcontext(&frame->uc.tuc_mcontext, env, frame_addr, set); + setup_sigcontext(&frame->uc.tuc_mcontext, env, frame_addr, set); for (i = 0; i < TARGET_NSIG_WORDS; ++i) { __put_user(set->sig[i], &frame->uc.tuc_sigmask.sig[i]); }