pid: mark struct pid* argument as const
authorŁukasz Stelmach <l.stelmach@samsung.com>
Tue, 2 Feb 2021 18:52:58 +0000 (19:52 +0100)
committerHoegeun Kwon <hoegeun.kwon@samsung.com>
Thu, 3 Aug 2023 08:46:12 +0000 (17:46 +0900)
Change-Id: I17a358ccbae656561e9e1df4ff3fe0055e4eaf20
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
include/linux/pid.h
kernel/pid.c

index af308e1..30d099f 100644 (file)
@@ -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);
 
index efe87db..80e34bb 100644 (file)
@@ -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();