Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp890888ybh; Wed, 22 Jul 2020 16:23:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzWmdWOLiCXl7ACghuRLmTxcXH9wK+rTFIXbFqsu6/WxmEHycorpFmxPf01fo0Fvsidpgy+ X-Received: by 2002:a17:906:e299:: with SMTP id gg25mr1807247ejb.160.1595460189260; Wed, 22 Jul 2020 16:23:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595460189; cv=none; d=google.com; s=arc-20160816; b=pGMqG0CRi+6GB9l5j9y2SVNH7sgdNyR/ozT4NAzjxVboopcolFkcoct05SiXQ6Pj6p P2cUnIDnINwcVgENzhbQm8i4H0bN192Zvr0YlL7lM1mi76phZFOK3PfIJ2hnHdiMslE9 q/yJM62X1EDisXIDMECxgRn1qLc1j7jnZXptESFtgOyBulktq/RG+gyKw0Dmb2hsJ722 kLi2hHYVhotWTxzRR8v1g7BV0F6PFihBE/CMT92bbd6HAOO39TVJAgJFSP2cyLumiThv R0vHsHni3jIvyFfXZBvkWcDaBldjn77xkQb1kFBw9KSDl24Gx8jMrHhb7xFr2/jrVxTk SmTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=6WvOoLTMYhtclAxTJdFSOrxU3owlzRyPtTPdIsxZbvI=; b=KAoamwi8r6g0hYyM9GEvoM3i2vePpnTnvGoz71vTgIiTRTyOV6P10E9XBMA9Y2l/Qi x7oxnIu4KEGeQsfl9dDYCseaAzeuE+sdZTlTfhO8ZhDQiRqX3WlEsvAhCVTNIHJktK0m yuW+9QTDNXNb8LTpubNhfaMpfolPniPRk4ci9KNuSUE4rIwbxWUKeT/xn1nN7S+2ns8j bBzXndh/pMgVrdho1YwZhceU64ZkXFKOw0YZxL2Ss6hC7wGKA1fxapmjpWDdDmOyVT7l DZfITKGqqOrqw0x077BfErclSIh46QcI+KvhercqWdGYY0/rYKDbuT8i/nWVGzQUFbd/ ujCg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dr17si1243799ejc.520.2020.07.22.16.22.47; Wed, 22 Jul 2020 16:23:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733248AbgGVXVV (ORCPT + 99 others); Wed, 22 Jul 2020 19:21:21 -0400 Received: from outpost17.zedat.fu-berlin.de ([130.133.4.110]:40571 "EHLO outpost17.zedat.fu-berlin.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733242AbgGVXVV (ORCPT ); Wed, 22 Jul 2020 19:21:21 -0400 X-Greylist: delayed 420 seconds by postgrey-1.27 at vger.kernel.org; Wed, 22 Jul 2020 19:21:08 EDT Received: from relay1.zedat.fu-berlin.de ([130.133.4.67]) by outpost.zedat.fu-berlin.de (Exim 4.93) with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (envelope-from ) id 1jyNwH-000bao-U8; Thu, 23 Jul 2020 01:14:17 +0200 Received: from mx.physik.fu-berlin.de ([160.45.64.218]) by relay1.zedat.fu-berlin.de (Exim 4.93) with esmtps (TLS1.2) tls TLS_DHE_RSA_WITH_AES_128_CBC_SHA (envelope-from ) id 1jyNwH-001IwG-Ra; Thu, 23 Jul 2020 01:14:17 +0200 Received: from epyc.physik.fu-berlin.de ([160.45.64.180]) by mx.physik.fu-berlin.de with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1jyNwB-0002Uf-Bg; Thu, 23 Jul 2020 01:14:11 +0200 Received: from mkarcher by epyc.physik.fu-berlin.de with local (Exim 4.94 #2 (Debian)) id 1jyNwB-001lBq-3K; Thu, 23 Jul 2020 01:14:11 +0200 From: Michael Karcher To: linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Yoshinori Sato , Rich Felker , Adrian Glaubitz , Michael Karcher Subject: [PATCH 4/4] sh: bring syscall_set_return_value in line with other architectures Date: Thu, 23 Jul 2020 01:13:22 +0200 Message-Id: <20200722231322.419642-4-kernel@mkarcher.dialup.fu-berlin.de> X-Mailer: git-send-email 2.28.0.rc1 In-Reply-To: <20200722231322.419642-1-kernel@mkarcher.dialup.fu-berlin.de> References: <20200722231322.419642-1-kernel@mkarcher.dialup.fu-berlin.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Originating-IP: 160.45.64.218 X-ZEDAT-Hint: RV Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Other architectures expect that syscall_set_return_value gets an already negative value as error. That's also what kernel/seccomp.c provides. Signed-off-by: Michael Karcher --- arch/sh/include/asm/syscall_32.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/arch/sh/include/asm/syscall_32.h b/arch/sh/include/asm/syscall_32.h index 0b5b8e75edac..cb51a7528384 100644 --- a/arch/sh/include/asm/syscall_32.h +++ b/arch/sh/include/asm/syscall_32.h @@ -40,10 +40,7 @@ static inline void syscall_set_return_value(struct task_struct *task, struct pt_regs *regs, int error, long val) { - if (error) - regs->regs[0] = -error; - else - regs->regs[0] = val; + regs->regs[0] = (long) error ?: val; } static inline void syscall_get_arguments(struct task_struct *task, -- 2.28.0.rc1