mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* x86: minor cleanup for ptrace_32/64
@ 2008-01-15 12:47 Jan Engelhardt
  2008-01-15 13:19 ` Ingo Molnar
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Engelhardt @ 2008-01-15 12:47 UTC (permalink / raw)
  To: mingo; +Cc: Linux Kernel Mailing List

commit abd7e7b7e05f8af290e7a7e6c5f3cbb57192523a
Author: Jan Engelhardt <jengelh@computergmbh.de>
Date:   Tue Jan 15 03:31:39 2008 +0100

    x86: minor cleanup
    
    - let get_stack_long from ptrace_32 use long (not int) for consistency
    - make put_stack_long() return void (return value not used anywhere)
    - add const keyword to args
    
    Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de>

diff --git a/arch/x86/kernel/ptrace_32.c b/arch/x86/kernel/ptrace_32.c
index ff5431c..339a1fa 100644
--- a/arch/x86/kernel/ptrace_32.c
+++ b/arch/x86/kernel/ptrace_32.c
@@ -57,13 +57,14 @@ static inline struct pt_regs *get_child_regs(struct task_struct *task)
  * This routine assumes that all the privileged stacks are in our
  * data space.
  */   
-static inline int get_stack_long(struct task_struct *task, int offset)
+static inline unsigned long
+get_stack_long(const struct task_struct *task, int offset)
 {
 	unsigned char *stack;
 
 	stack = (unsigned char *)task->thread.esp0 - sizeof(struct pt_regs);
 	stack += offset;
-	return (*((int *)stack));
+	return *(unsigned long *)stack;
 }
 
 /*
@@ -72,7 +73,7 @@ static inline int get_stack_long(struct task_struct *task, int offset)
  * This routine assumes that all the privileged stacks are in our
  * data space.
  */
-static inline int put_stack_long(struct task_struct *task, int offset,
+static inline void put_stack_long(const struct task_struct *task, int offset,
 	unsigned long data)
 {
 	unsigned char * stack;
@@ -80,7 +81,6 @@ static inline int put_stack_long(struct task_struct *task, int offset,
 	stack = (unsigned char *)task->thread.esp0 - sizeof(struct pt_regs);
 	stack += offset;
 	*(unsigned long *) stack = data;
-	return 0;
 }
 
 static int putreg(struct task_struct *child,
diff --git a/arch/x86/kernel/ptrace_64.c b/arch/x86/kernel/ptrace_64.c
index 607085f..b60ed76 100644
--- a/arch/x86/kernel/ptrace_64.c
+++ b/arch/x86/kernel/ptrace_64.c
@@ -56,13 +56,14 @@
  * this routine assumes that all the privileged stacks are in our
  * data space.
  */   
-static inline unsigned long get_stack_long(struct task_struct *task, int offset)
+static inline unsigned long
+get_stack_long(const struct task_struct *task, int offset)
 {
 	unsigned char *stack;
 
 	stack = (unsigned char *)task->thread.rsp0;
 	stack += offset;
-	return (*((unsigned long *)stack));
+	return *(unsigned long *)stack;
 }
 
 /*
@@ -71,7 +72,7 @@ static inline unsigned long get_stack_long(struct task_struct *task, int offset)
  * this routine assumes that all the privileged stacks are in our
  * data space.
  */
-static inline long put_stack_long(struct task_struct *task, int offset,
+static inline void put_stack_long(const struct task_struct *task, int offset,
 	unsigned long data)
 {
 	unsigned char * stack;
@@ -79,7 +80,6 @@ static inline long put_stack_long(struct task_struct *task, int offset,
 	stack = (unsigned char *) task->thread.rsp0;
 	stack += offset;
 	*(unsigned long *) stack = data;
-	return 0;
 }
 
 #define LDT_SEGMENT 4



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: x86: minor cleanup for ptrace_32/64
  2008-01-15 12:47 x86: minor cleanup for ptrace_32/64 Jan Engelhardt
@ 2008-01-15 13:19 ` Ingo Molnar
  0 siblings, 0 replies; 2+ messages in thread
From: Ingo Molnar @ 2008-01-15 13:19 UTC (permalink / raw)
  To: Jan Engelhardt; +Cc: Linux Kernel Mailing List


* Jan Engelhardt <jengelh@computergmbh.de> wrote:

>     x86: minor cleanup
>     
>     - let get_stack_long from ptrace_32 use long (not int) for consistency
>     - make put_stack_long() return void (return value not used anywhere)
>     - add const keyword to args

ptrace*.c has been unified into ptrace.c in x86.git's mm branch. (see 
the instructions below about how to pick up the latest x86.git repo)

	Ingo

--------------{ x86.git instructions }---------->

# Add Linus's tree as a remote
git remote --add linus
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git

# Add Ingo's tree as a remote
git remote --add x86
git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86.git

# With that setup, just run the following to get any changes you
# don't have.  It will also notice any new branches Ingo/Linus
# add to their repo.  Look in .git/config afterwards, the format
# to add new remotes is easy to figure out.
git remote update


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-01-15 13:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-15 12:47 x86: minor cleanup for ptrace_32/64 Jan Engelhardt
2008-01-15 13:19 ` Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®