From 64f46e399a73f85363328b5bb0c017740b1bc839 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C5=81ukasz=20Stelmach?= Date: Tue, 2 Feb 2021 19:52:58 +0100 Subject: [PATCH] pid: mark struct pid* argument as const MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Change-Id: I17a358ccbae656561e9e1df4ff3fe0055e4eaf20 Signed-off-by: Łukasz Stelmach --- include/linux/pid.h | 4 ++-- kernel/pid.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/linux/pid.h b/include/linux/pid.h index af308e1..30d099f 100644 --- a/include/linux/pid.h +++ b/include/linux/pid.h @@ -88,12 +88,12 @@ static inline struct pid *get_pid(struct pid *pid) } extern void put_pid(struct pid *pid); -extern struct task_struct *pid_task(struct pid *pid, enum pid_type); +extern struct task_struct *pid_task(const struct pid *pid, enum pid_type); static inline bool pid_has_task(struct pid *pid, enum pid_type type) { return !hlist_empty(&pid->tasks[type]); } -extern struct task_struct *get_pid_task(struct pid *pid, enum pid_type); +extern struct task_struct *get_pid_task(const struct pid *pid, enum pid_type); extern struct pid *get_task_pid(struct task_struct *task, enum pid_type type); diff --git a/kernel/pid.c b/kernel/pid.c index efe87db..80e34bb 100644 --- a/kernel/pid.c +++ b/kernel/pid.c @@ -393,7 +393,7 @@ void transfer_pid(struct task_struct *old, struct task_struct *new, hlist_replace_rcu(&old->pid_links[type], &new->pid_links[type]); } -struct task_struct *pid_task(struct pid *pid, enum pid_type type) +struct task_struct *pid_task(const struct pid *pid, enum pid_type type) { struct task_struct *result = NULL; if (pid) { @@ -445,7 +445,7 @@ struct pid *get_task_pid(struct task_struct *task, enum pid_type type) } EXPORT_SYMBOL_GPL(get_task_pid); -struct task_struct *get_pid_task(struct pid *pid, enum pid_type type) +struct task_struct *get_pid_task(const struct pid *pid, enum pid_type type) { struct task_struct *result; rcu_read_lock(); -- 2.7.4