History

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.

Qian Cai committed 7 years ago

Commit 42fd8ba1 parent dac9f021 file · +4 −1Browse files

Showing the changes to include/linux (1 of 1 file). Show all

Unified · Split

include/linux/sched.h+4−1
@@ -1856,7 +1856,10 @@ static inline void set_task_cpu(struct task_struct *p, unsigned int cpu) · 1855 unmodified lines
1856 * running or not.1856 * running or not.
1857 */1857 */
1858#ifndef vcpu_is_preempted1858#ifndef vcpu_is_preempted
1859# define vcpu_is_preempted(cpu) false1859static inline bool vcpu_is_preempted(int cpu)
1860{
1861 return false;
1862}
1860#endif1863#endif
1861 1864
1862extern long sched_setaffinity(pid_t pid, const struct cpumask *new_mask);1865extern long sched_setaffinity(pid_t pid, const struct cpumask *new_mask);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t