From patchwork Tue Jun 17 14:56:46 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 32040 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f70.google.com (mail-pa0-f70.google.com [209.85.220.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id EDAF0206A0 for ; Tue, 17 Jun 2014 15:01:54 +0000 (UTC) Received: by mail-pa0-f70.google.com with SMTP id lj1sf28028049pab.1 for ; Tue, 17 Jun 2014 08:01:54 -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:in-reply-to:references:cc: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=tV8xA8y7brY1Frv00+Ci7inOxYTiamHPbaWKXiM6/Kk=; b=iqDbzF/rkbZQgjnCdJP2qD7KzRLc0gXmzidhiahlWhSTtXfbvLm3pf1tHjR5iofVL0 5lj1HnnfDjTzlj7xBZ4Vsi/2NTpFPaYfTJl8QIpeDAuX7TdS2rTgS4RUUpTJM9bn/28n S+yzV+3yLorJkK75U14lmIRi+iDgktk7xktfiLq8hSiUrgHr4s3tW3TYdJ39PdI4xPzl 2UYGd9fBWjJg05HLH2qIKy+s9SorOm3hG0cFXd7EqYNFAKv/S36FODjZPmy66SKRrb2U 1UGJhMiaAEE9dM163nuntGTW5ovlWMezHgZFt4SIZ7l7SlIAnPmvAPFaqjm69URbzh4h Tv+Q== X-Gm-Message-State: ALoCoQlZoneymZRI7MF4ERuG9YeftrlOxNBE7ZB2NtQDETizcARI5haOD8ZSeRkOgtARu17WmN8P X-Received: by 10.66.231.68 with SMTP id te4mr10891pac.29.1403017314173; Tue, 17 Jun 2014 08:01:54 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.19.83 with SMTP id 77ls4971336qgg.28.gmail; Tue, 17 Jun 2014 08:01:54 -0700 (PDT) X-Received: by 10.220.106.7 with SMTP id v7mr857070vco.46.1403017314053; Tue, 17 Jun 2014 08:01:54 -0700 (PDT) Received: from mail-vc0-f171.google.com (mail-vc0-f171.google.com [209.85.220.171]) by mx.google.com with ESMTPS id bh5si5571655vcb.61.2014.06.17.08.01.54 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 17 Jun 2014 08:01:54 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.171 as permitted sender) client-ip=209.85.220.171; Received: by mail-vc0-f171.google.com with SMTP id id10so6665903vcb.30 for ; Tue, 17 Jun 2014 08:01:54 -0700 (PDT) X-Received: by 10.53.8.162 with SMTP id dl2mr18620451vdd.24.1403017313930; Tue, 17 Jun 2014 08:01:53 -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.221.54.6 with SMTP id vs6csp215967vcb; Tue, 17 Jun 2014 08:01:53 -0700 (PDT) X-Received: by 10.224.128.193 with SMTP id l1mr15158203qas.91.1403017313475; Tue, 17 Jun 2014 08:01:53 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id i4si14111825qge.31.2014.06.17.08.01.53 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 17 Jun 2014 08:01:53 -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]:51170 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WwutV-00044p-43 for patch@linaro.org; Tue, 17 Jun 2014 11:01:53 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43964) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wwuoy-0005hU-LZ for qemu-devel@nongnu.org; Tue, 17 Jun 2014 10:57:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wwuor-0004PN-MJ for qemu-devel@nongnu.org; Tue, 17 Jun 2014 10:57:12 -0400 Received: from afflict.kos.to ([92.243.29.197]:46236) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wwuoq-0004OJ-WE for qemu-devel@nongnu.org; Tue, 17 Jun 2014 10:57:05 -0400 Received: from afflict.kos.to (afflict [92.243.29.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by afflict.kos.to (Postfix) with ESMTPSA id 2EFB72651C; Tue, 17 Jun 2014 16:57:03 +0200 (CEST) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Tue, 17 Jun 2014 17:56:46 +0300 Message-Id: X-Mailer: git-send-email 1.7.10.4 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 92.243.29.197 Cc: peter.maydell@linaro.org, Riku Voipio Subject: [Qemu-devel] [PULL v2 03/17] signal/all: remove return value from copy_siginfo_to_user 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=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.171 as permitted sender) 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 Since copy_siginfo_to_user always returns 0, make it void and remove any checks for return value from calling functions. Signed-off-by: Riku Voipio Reviewed-by: Peter Maydell --- linux-user/signal.c | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/linux-user/signal.c b/linux-user/signal.c index cf283a8..74c54bf 100644 --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -721,11 +721,10 @@ int do_sigaction(int sig, const struct target_sigaction *act, return ret; } -static inline int copy_siginfo_to_user(target_siginfo_t *tinfo, +static inline void copy_siginfo_to_user(target_siginfo_t *tinfo, const target_siginfo_t *info) { tswap_siginfo(tinfo, info); - return 0; } static inline int current_exec_domain_sig(int sig) @@ -985,9 +984,7 @@ static void setup_rt_frame(int sig, struct target_sigaction *ka, __put_user(addr, &frame->pinfo); addr = frame_addr + offsetof(struct rt_sigframe, uc); __put_user(addr, &frame->puc); - err |= copy_siginfo_to_user(&frame->info, info); - if (err) - goto give_sigsegv; + copy_siginfo_to_user(&frame->info, info); /* Create the ucontext. */ __put_user(0, &frame->uc.tuc_flags); @@ -1361,9 +1358,7 @@ static void target_setup_frame(int usig, struct target_sigaction *ka, env->pc = ka->_sa_handler; env->xregs[30] = return_addr; if (info) { - if (copy_siginfo_to_user(&frame->info, info)) { - goto give_sigsegv; - } + copy_siginfo_to_user(&frame->info, info); env->xregs[1] = frame_addr + offsetof(struct target_rt_sigframe, info); env->xregs[2] = frame_addr + offsetof(struct target_rt_sigframe, uc); } @@ -3361,7 +3356,7 @@ static void setup_rt_frame(int sig, struct target_sigaction *ka, signal = current_exec_domain_sig(sig); - err |= copy_siginfo_to_user(&frame->info, info); + copy_siginfo_to_user(&frame->info, info); /* Create the ucontext. */ __put_user(0, &frame->uc.tuc_flags); @@ -4041,10 +4036,7 @@ static void setup_rt_frame(int sig, struct target_sigaction *ka, __put_user(uc_addr, &frame->puc); if (ka->sa_flags & SA_SIGINFO) { - err |= copy_siginfo_to_user(&frame->info, info); - } - if (err) { - goto give_sigsegv; + copy_siginfo_to_user(&frame->info, info); } /*err |= __clear_user(&frame->uc, offsetof(struct ucontext, uc_mcontext));*/ @@ -4304,9 +4296,7 @@ static void setup_rt_frame(int sig, struct target_sigaction *ka, } qemu_log("%s: 1\n", __FUNCTION__); - if (copy_siginfo_to_user(&frame->info, info)) { - goto give_sigsegv; - } + copy_siginfo_to_user(&frame->info, info); /* Create the ucontext. */ __put_user(0, &frame->uc.tuc_flags); @@ -4880,7 +4870,7 @@ static void setup_rt_frame(int sig, struct target_sigaction *ka, signal = current_exec_domain_sig(sig); - err |= copy_siginfo_to_user(&rt_sf->info, info); + copy_siginfo_to_user(&rt_sf->info, info); __put_user(0, &rt_sf->uc.tuc_flags); __put_user(0, &rt_sf->uc.tuc_link); @@ -5298,7 +5288,7 @@ static void setup_rt_frame(int sig, struct target_sigaction *ka, uc_addr = frame_addr + offsetof(struct target_rt_sigframe, uc); __put_user(uc_addr, &frame->puc); - err |= copy_siginfo_to_user(&frame->info, info); + copy_siginfo_to_user(&frame->info, info); /* Create the ucontext */ @@ -5584,7 +5574,7 @@ static void setup_rt_frame(int sig, struct target_sigaction *ka, goto give_sigsegv; } - err |= copy_siginfo_to_user(&frame->info, info); + copy_siginfo_to_user(&frame->info, info); __put_user(0, &frame->uc.tuc_flags); __put_user(0, &frame->uc.tuc_link);