Skip to content

Commit

Permalink
sched: Make cookie functions static
Browse files Browse the repository at this point in the history
Make cookie functions static as these are no longer invoked directly
by other code.

No functional change intended.

Signed-off-by: Shaokun Zhang <zhangshaokun@hisilicon.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20210922085735.52812-1-zhangshaokun@hisilicon.com
  • Loading branch information
Shaokun Zhang authored and Peter Zijlstra committed Oct 5, 2021
1 parent 4006a72 commit d07b2ee
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
9 changes: 5 additions & 4 deletions kernel/sched/core_sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ struct sched_core_cookie {
refcount_t refcnt;
};

unsigned long sched_core_alloc_cookie(void)
static unsigned long sched_core_alloc_cookie(void)
{
struct sched_core_cookie *ck = kmalloc(sizeof(*ck), GFP_KERNEL);
if (!ck)
Expand All @@ -23,7 +23,7 @@ unsigned long sched_core_alloc_cookie(void)
return (unsigned long)ck;
}

void sched_core_put_cookie(unsigned long cookie)
static void sched_core_put_cookie(unsigned long cookie)
{
struct sched_core_cookie *ptr = (void *)cookie;

Expand All @@ -33,7 +33,7 @@ void sched_core_put_cookie(unsigned long cookie)
}
}

unsigned long sched_core_get_cookie(unsigned long cookie)
static unsigned long sched_core_get_cookie(unsigned long cookie)
{
struct sched_core_cookie *ptr = (void *)cookie;

Expand All @@ -53,7 +53,8 @@ unsigned long sched_core_get_cookie(unsigned long cookie)
*
* Returns: the old cookie
*/
unsigned long sched_core_update_cookie(struct task_struct *p, unsigned long cookie)
static unsigned long sched_core_update_cookie(struct task_struct *p,
unsigned long cookie)
{
unsigned long old_cookie;
struct rq_flags rf;
Expand Down
5 changes: 0 additions & 5 deletions kernel/sched/sched.h
Original file line number Diff line number Diff line change
Expand Up @@ -1258,11 +1258,6 @@ extern void sched_core_dequeue(struct rq *rq, struct task_struct *p);
extern void sched_core_get(void);
extern void sched_core_put(void);

extern unsigned long sched_core_alloc_cookie(void);
extern void sched_core_put_cookie(unsigned long cookie);
extern unsigned long sched_core_get_cookie(unsigned long cookie);
extern unsigned long sched_core_update_cookie(struct task_struct *p, unsigned long cookie);

#else /* !CONFIG_SCHED_CORE */

static inline bool sched_core_enabled(struct rq *rq)
Expand Down

0 comments on commit d07b2ee

Please sign in to comment.