Skip to content

Commit 42fd8ba

Browse files
Qian Caiingomolnar
authored andcommitted
sched/core: Convert vcpu_is_preempted() from macro to an inline function
Clang reports this warning: kernel/locking/osq_lock.c:25:19: warning: unused function 'node_cpu' [-Wunused-function] due to osq_lock() calling vcpu_is_preempted(node_cpu(node->prev))), but vcpu_is_preempted() is compiled away. Fix it by converting the dummy vcpu_is_preempted() from a macro to a proper static inline function. Signed-off-by: Qian Cai <cai@lca.pw> Acked-by: Mel Gorman <mgorman@suse.de> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: bsegall@google.com Cc: dietmar.eggemann@arm.com Cc: juri.lelli@redhat.com Cc: rostedt@goodmis.org Cc: vincent.guittot@linaro.org Link: https://lkml.kernel.org/r/1568730894-10483-1-git-send-email-cai@lca.pw Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent dac9f02 commit 42fd8ba

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎include/linux/sched.h‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1856,7 +1856,10 @@ static inline void set_task_cpu(struct task_struct *p, unsigned int cpu)
18561856
* running or not.
18571857
*/
18581858
#ifndef vcpu_is_preempted
1859-
# define vcpu_is_preempted(cpu) false
1859+
static inline bool vcpu_is_preempted(int cpu)
1860+
{
1861+
return false;
1862+
}
18601863
#endif
18611864

18621865
extern long sched_setaffinity(pid_t pid, const struct cpumask *new_mask);

0 commit comments

Comments
 (0)