From patchwork Tue Jun 10 13:20:32 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 31650 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f197.google.com (mail-ve0-f197.google.com [209.85.128.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3EB4720675 for ; Tue, 10 Jun 2014 13:22:08 +0000 (UTC) Received: by mail-ve0-f197.google.com with SMTP id jz11sf16115244veb.0 for ; Tue, 10 Jun 2014 06:22:08 -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=tV8xA8y7brY1Frv00+Ci7inOxYTiamHPbaWKXiM6/Kk=; b=OXF39BloKwmgRR9U+gLylDhbrYPgPvlmJbF5WalubNfR+dIfrP8qibie2bKYESZfdw 7FDMNdSwquKwk3ZWZCDyH1g8UZBa7hwgPOiLjnXTRM1bARbEoBRBtnVg2aYNZxc1F2/F TM8zWjGqzoR/9JRt5hUobw933HCCgA5LCzb/dxqFxZHAAJAerRYMRIwhGmEp7JmopqV8 gTW2cyzZddsG6o2BFVLykCGuKFQYuPae6JkJr2mW8lcJ50pZBNBtXKoAGoZO7ncPCwWn ul/idceJSxOy0lpkVdKK9DZmH4v/ANJZ3aQ6DUP+78I5L/LgjVS9lslzU2OwzndfUVui 76Fw== X-Gm-Message-State: ALoCoQl7GBzbbTLtNYJu6ukI0gMrlNgjCy8M/63FkUxo98tSC3xHCAePKxRZNyUdIe+cv0nstfWy X-Received: by 10.58.164.226 with SMTP id yt2mr16718068veb.7.1402406528055; Tue, 10 Jun 2014 06:22:08 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.37.230 with SMTP id r93ls279183qgr.10.gmail; Tue, 10 Jun 2014 06:22:07 -0700 (PDT) X-Received: by 10.52.108.162 with SMTP id hl2mr564367vdb.84.1402406527824; Tue, 10 Jun 2014 06:22:07 -0700 (PDT) Received: from mail-ve0-f171.google.com (mail-ve0-f171.google.com [209.85.128.171]) by mx.google.com with ESMTPS id g6si13065513vdk.30.2014.06.10.06.22.07 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 10 Jun 2014 06:22:07 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.171 as permitted sender) client-ip=209.85.128.171; Received: by mail-ve0-f171.google.com with SMTP id jz11so4025360veb.30 for ; Tue, 10 Jun 2014 06:22:07 -0700 (PDT) X-Received: by 10.52.25.130 with SMTP id c2mr26892735vdg.27.1402406527732; Tue, 10 Jun 2014 06:22:07 -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 vs6csp224898vcb; Tue, 10 Jun 2014 06:22:07 -0700 (PDT) X-Received: by 10.140.87.5 with SMTP id q5mr40444363qgd.43.1402406526797; Tue, 10 Jun 2014 06:22:06 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id s7si27518861qat.102.2014.06.10.06.22.06 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 10 Jun 2014 06:22:06 -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]:39738 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WuM06-0001c3-BE for patch@linaro.org; Tue, 10 Jun 2014 09:22:06 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53730) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WuLyz-0000LZ-AJ for qemu-devel@nongnu.org; Tue, 10 Jun 2014 09:21:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WuLyo-0007Z8-Ts for qemu-devel@nongnu.org; Tue, 10 Jun 2014 09:20:57 -0400 Received: from [2001:4b98:dc0:45:216:3eff:fe3d:166f] (port=56212 helo=afflict.kos.to) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WuLyo-0007Yq-JO for qemu-devel@nongnu.org; Tue, 10 Jun 2014 09:20: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 25E3D2651C; Tue, 10 Jun 2014 15:20:45 +0200 (CEST) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Tue, 10 Jun 2014 16:20:32 +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: Riku Voipio Subject: [Qemu-devel] [PATCH v3 03/13] 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.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);