linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Dmitry V. Levin" <ldv@altlinux.org>
To: Greentime Hu <green.hu@gmail.com>, Vincent Chen <deanbo422@gmail.com>
Cc: Elvira Khabirova <lineprinter@altlinux.org>,
	Eugene Syromyatnikov <esyr@redhat.com>,
	Andy Lutomirski <luto@kernel.org>,
	Oleg Nesterov <oleg@redhat.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH] nds32: fix asm/syscall.h
Date: Mon, 7 Jan 2019 15:54:43 +0300	[thread overview]
Message-ID: <20190107125443.GA8489@altlinux.org> (raw)
In-Reply-To: <201901071430.4jk67u0s%fengguang.wu@intel.com>

All syscall_get_* and syscall_set_* functions must be defined as
static inline.

Reported-by: kbuild test robot <lkp@intel.com>
Fixes: 1932fbe36e02 ("nds32: System calls handling")
Cc: Greentime Hu <green.hu@gmail.com>
Cc: Vincent Chen <deanbo422@gmail.com>
Cc: Elvira Khabirova <lineprinter@altlinux.org>
Cc: Eugene Syromyatnikov <esyr@redhat.com>
Cc: stable@vger.kernel.org # v4.17+
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
---
 arch/nds32/include/asm/syscall.h | 29 ++++++++++++++++++-----------
 1 file changed, 18 insertions(+), 11 deletions(-)

diff --git a/arch/nds32/include/asm/syscall.h b/arch/nds32/include/asm/syscall.h
index f7e5e86765fe..6b131202d0e9 100644
--- a/arch/nds32/include/asm/syscall.h
+++ b/arch/nds32/include/asm/syscall.h
@@ -25,7 +25,8 @@ struct pt_regs;
  *
  * It's only valid to call this when @task is known to be blocked.
  */
-int syscall_get_nr(struct task_struct *task, struct pt_regs *regs)
+static inline int
+syscall_get_nr(struct task_struct *task, struct pt_regs *regs)
 {
 	return regs->syscallno;
 }
@@ -46,7 +47,8 @@ int syscall_get_nr(struct task_struct *task, struct pt_regs *regs)
  * system call instruction.  This may not be the same as what the
  * register state looked like at system call entry tracing.
  */
-void syscall_rollback(struct task_struct *task, struct pt_regs *regs)
+static inline void
+syscall_rollback(struct task_struct *task, struct pt_regs *regs)
 {
 	regs->uregs[0] = regs->orig_r0;
 }
@@ -61,7 +63,8 @@ void syscall_rollback(struct task_struct *task, struct pt_regs *regs)
  * It's only valid to call this when @task is stopped for tracing on exit
  * from a system call, due to %TIF_SYSCALL_TRACE or %TIF_SYSCALL_AUDIT.
  */
-long syscall_get_error(struct task_struct *task, struct pt_regs *regs)
+static inline long
+syscall_get_error(struct task_struct *task, struct pt_regs *regs)
 {
 	unsigned long error = regs->uregs[0];
 	return IS_ERR_VALUE(error) ? error : 0;
@@ -78,7 +81,8 @@ long syscall_get_error(struct task_struct *task, struct pt_regs *regs)
  * It's only valid to call this when @task is stopped for tracing on exit
  * from a system call, due to %TIF_SYSCALL_TRACE or %TIF_SYSCALL_AUDIT.
  */
-long syscall_get_return_value(struct task_struct *task, struct pt_regs *regs)
+static inline long
+syscall_get_return_value(struct task_struct *task, struct pt_regs *regs)
 {
 	return regs->uregs[0];
 }
@@ -98,8 +102,9 @@ long syscall_get_return_value(struct task_struct *task, struct pt_regs *regs)
  * It's only valid to call this when @task is stopped for tracing on exit
  * from a system call, due to %TIF_SYSCALL_TRACE or %TIF_SYSCALL_AUDIT.
  */
-void syscall_set_return_value(struct task_struct *task, struct pt_regs *regs,
-			      int error, long val)
+static inline void
+syscall_set_return_value(struct task_struct *task, struct pt_regs *regs,
+			 int error, long val)
 {
 	regs->uregs[0] = (long)error ? error : val;
 }
@@ -122,8 +127,9 @@ void syscall_set_return_value(struct task_struct *task, struct pt_regs *regs,
  * taking up to 6 arguments.
  */
 #define SYSCALL_MAX_ARGS 6
-void syscall_get_arguments(struct task_struct *task, struct pt_regs *regs,
-			   unsigned int i, unsigned int n, unsigned long *args)
+static inline void
+syscall_get_arguments(struct task_struct *task, struct pt_regs *regs,
+		      unsigned int i, unsigned int n, unsigned long *args)
 {
 	if (n == 0)
 		return;
@@ -163,9 +169,10 @@ void syscall_get_arguments(struct task_struct *task, struct pt_regs *regs,
  * It's invalid to call this with @i + @n > 6; we only support system calls
  * taking up to 6 arguments.
  */
-void syscall_set_arguments(struct task_struct *task, struct pt_regs *regs,
-			   unsigned int i, unsigned int n,
-			   const unsigned long *args)
+static inline void
+syscall_set_arguments(struct task_struct *task, struct pt_regs *regs,
+		      unsigned int i, unsigned int n,
+		      const unsigned long *args)
 {
 	if (n == 0)
 		return;
-- 
ldv

  parent reply	other threads:[~2019-01-07 12:54 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20190107025101.GA1182@altlinux.org>
2019-01-07  2:52 ` [PATCH v7 01/22] asm-generic/syscall.h: prepare for inclusion by other files Dmitry V. Levin
2019-01-07  2:52 ` [PATCH v7 02/22] asm-generic/syscall.h: turn syscall_[gs]et_arguments into wrappers Dmitry V. Levin
2019-01-07  2:52 ` [PATCH v7 03/22] alpha: define remaining syscall_get_* functions Dmitry V. Levin
2019-01-07  7:25   ` kbuild test robot
2019-01-07  2:53 ` [PATCH v7 04/22] Move EM_ARCOMPACT and EM_ARCV2 to uapi/linux/elf-em.h Dmitry V. Levin
2019-01-07  2:53 ` [PATCH v7 05/22] arc: define syscall_get_arch() Dmitry V. Levin
2019-01-07  2:53 ` [PATCH v7 06/22] c6x: " Dmitry V. Levin
2019-01-07  2:53 ` [PATCH v7 07/22] h8300: define remaining syscall_get_* functions Dmitry V. Levin
2019-01-07  2:53 ` [PATCH v7 08/22] Move EM_HEXAGON to uapi/linux/elf-em.h Dmitry V. Levin
2019-01-07  2:53 ` [PATCH v7 09/22] hexagon: define remaining syscall_get_* functions Dmitry V. Levin
2019-01-07  2:53 ` [PATCH v7 10/22] Move EM_NDS32 to uapi/linux/elf-em.h Dmitry V. Levin
2019-01-07  2:53 ` [PATCH v7 11/22] nds32: define syscall_get_arch() Dmitry V. Levin
2019-01-07  2:53 ` [PATCH v7 12/22] nios2: " Dmitry V. Levin
2019-01-07  2:54 ` [PATCH v7 13/22] m68k: add asm/syscall.h Dmitry V. Levin
2019-01-07  2:54 ` [PATCH v7 14/22] mips: define syscall_get_error() Dmitry V. Levin
2019-01-07  2:54 ` [PATCH v7 15/22] parisc: " Dmitry V. Levin
2019-02-28 19:38   ` Dmitry V. Levin
2019-02-28 21:39     ` Helge Deller
2019-01-07  2:54 ` [PATCH v7 16/22] powerpc: " Dmitry V. Levin
2019-02-28 19:39   ` Dmitry V. Levin
2019-01-07  2:54 ` [PATCH v7 17/22] riscv: define syscall_get_arch() Dmitry V. Levin
2019-01-07  2:54 ` [PATCH v7 18/22] Move EM_UNICORE to uapi/linux/elf-em.h Dmitry V. Levin
2019-01-07  2:54 ` [PATCH v7 19/22] unicore32: add asm/syscall.h Dmitry V. Levin
2019-01-07  2:54 ` [PATCH v7 20/22] syscall_get_arch: add "struct task_struct *" argument Dmitry V. Levin
2019-01-07  2:54 ` [PATCH v7 21/22] ptrace: add PTRACE_GET_SYSCALL_INFO request Dmitry V. Levin
2019-01-07  7:05   ` kbuild test robot
2019-01-07 14:58     ` Dmitry V. Levin
     [not found]   ` <201901071430.4jk67u0s%fengguang.wu@intel.com>
2019-01-07 12:54     ` Dmitry V. Levin [this message]
2019-02-28 21:58       ` [PATCH] nds32: fix asm/syscall.h Dmitry V. Levin
2019-01-07  2:55 ` [PATCH v7 22/22] selftests/ptrace: add a test case for PTRACE_GET_SYSCALL_INFO Dmitry V. Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190107125443.GA8489@altlinux.org \
    --to=ldv@altlinux.org \
    --cc=deanbo422@gmail.com \
    --cc=esyr@redhat.com \
    --cc=green.hu@gmail.com \
    --cc=lineprinter@altlinux.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=oleg@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).