From patchwork Mon Jun 9 12:46:28 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 31557 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f199.google.com (mail-qc0-f199.google.com [209.85.216.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C80EB20675 for ; Mon, 9 Jun 2014 12:54:03 +0000 (UTC) Received: by mail-qc0-f199.google.com with SMTP id i17sf1890366qcy.6 for ; Mon, 09 Jun 2014 05:54:03 -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: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=zh07XoMlVyOFTCZAn2KIyJqvuDJT81sHpClN/pJRjgs=; b=AmkKp1Uhta85/WwWzCeKQtMEHJXUNLR2iA/yAYr4t3TPgR0B0clA8tmq25RclAw6kA dcGmOR3xehqdqntVTYypvhwFnbNx/mH8jP0VPNHZihiWFQPgW2UAN/1LZrrzw1iuNIWu jYCvPGT1PbCY1hfbUPX77ov+8/dSLn/Cz18hAyxdnuIUUck5WermWfPAGHKoZJELXGME tUzPLKHpcR7lYjkfSJCSm++CIqUSvyIIZUozdsP7NybcnO5WSYI4GufoYIFvb31BY+VA VmKeUmcPqYl2Zl1n8HRn1ioNIJfUgqN/ASN6vvBc/HV+f7hfweXKHIcyHoRM+YfvEaFh GzPg== X-Gm-Message-State: ALoCoQncqGWTOA6LRLunODrojqWp2eYRV4paKjRdY9W2jDyT5JRkvXpNWE16cY3T6BFNWG0rDEa7 X-Received: by 10.58.126.40 with SMTP id mv8mr2154774veb.13.1402318443657; Mon, 09 Jun 2014 05:54:03 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.102.87 with SMTP id v81ls1585578qge.0.gmail; Mon, 09 Jun 2014 05:54:03 -0700 (PDT) X-Received: by 10.58.74.164 with SMTP id u4mr54353vev.81.1402318443557; Mon, 09 Jun 2014 05:54:03 -0700 (PDT) Received: from mail-ve0-f181.google.com (mail-ve0-f181.google.com [209.85.128.181]) by mx.google.com with ESMTPS id uy14si7900820veb.28.2014.06.09.05.54.03 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 09 Jun 2014 05:54:03 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.181 as permitted sender) client-ip=209.85.128.181; Received: by mail-ve0-f181.google.com with SMTP id db11so1002026veb.40 for ; Mon, 09 Jun 2014 05:54:03 -0700 (PDT) X-Received: by 10.220.44.141 with SMTP id a13mr192469vcf.71.1402318443473; Mon, 09 Jun 2014 05:54:03 -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 vs6csp143650vcb; Mon, 9 Jun 2014 05:54:03 -0700 (PDT) X-Received: by 10.229.227.5 with SMTP id iy5mr32215890qcb.1.1402318443007; Mon, 09 Jun 2014 05:54:03 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id 3si1479216qau.90.2014.06.09.05.54.02 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 09 Jun 2014 05:54:03 -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]:60905 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wtz5O-0007ld-LQ for patch@linaro.org; Mon, 09 Jun 2014 08:54:02 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44898) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WtyyT-0005cL-EV for qemu-devel@nongnu.org; Mon, 09 Jun 2014 08:47:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WtyyM-0007gM-BG for qemu-devel@nongnu.org; Mon, 09 Jun 2014 08:46:53 -0400 Received: from [2001:4b98:dc0:45:216:3eff:fe3d:166f] (port=55278 helo=afflict.kos.to) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WtyyM-0007fz-16 for qemu-devel@nongnu.org; Mon, 09 Jun 2014 08:46:46 -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 7FEDC2651C; Mon, 9 Jun 2014 14:46:44 +0200 (CEST) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Mon, 9 Jun 2014 15:46:28 +0300 Message-Id: X-Mailer: git-send-email 1.7.10.4 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 2001:4b98:dc0:45:216:3eff:fe3d:166f Cc: peter.maydell@linaro.org, Riku Voipio Subject: [Qemu-devel] [PULL 03/18] 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.128.181 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 ed2f50f..0bf6213 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); @@ -5299,7 +5289,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 */ @@ -5585,7 +5575,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);