History

workqueue: Remove unused work_on_cpu_safe

The last use of the work_on_cpu_safe() macro was removed recently by commit 9cda46babdfe ("crypto: n2 - remove Niagara2 SPU driver") Remove it, and the work_on_cpu_safe_key() function it calls.

Dr. David Alan Gilbert committed 1 year ago

Commit fc2898e1 parent f11113d2 files · +0 −38Browse files

Unified · Split

2 files
  1. include/linux/workqueue.h +0 −13
  2. kernel/workqueue.c +0 −25
include/linux/workqueue.h+0−13
@@ -847,19 +847,6 @@ long work_on_cpu_key(int cpu, long (*fn)(void *), · 846 unmodified lines
847 work_on_cpu_key(_cpu, _fn, _arg, &__key); \847 work_on_cpu_key(_cpu, _fn, _arg, &__key); \
848})848})
849 849
850long work_on_cpu_safe_key(int cpu, long (*fn)(void *),
851 void *arg, struct lock_class_key *key);
852
853/*
854 * A new key is defined for each caller to make sure the work
855 * associated with the function doesn't share its locking class.
856 */
857#define work_on_cpu_safe(_cpu, _fn, _arg) \
858({ \
859 static struct lock_class_key __key; \
860 \
861 work_on_cpu_safe_key(_cpu, _fn, _arg, &__key); \
862})
863#endif /* CONFIG_SMP */850#endif /* CONFIG_SMP */
864 851
865#ifdef CONFIG_FREEZER852#ifdef CONFIG_FREEZER
kernel/workqueue.c+0−25
@@ -6771,31 +6771,6 @@ long work_on_cpu_key(int cpu, long (*fn)(void *), · 6770 unmodified lines
6771 return wfc.ret;6771 return wfc.ret;
6772}6772}
6773EXPORT_SYMBOL_GPL(work_on_cpu_key);6773EXPORT_SYMBOL_GPL(work_on_cpu_key);
6774
6775/**
6776 * work_on_cpu_safe_key - run a function in thread context on a particular cpu
6777 * @cpu: the cpu to run on
6778 * @fn: the function to run
6779 * @arg: the function argument
6780 * @key: The lock class key for lock debugging purposes
6781 *
6782 * Disables CPU hotplug and calls work_on_cpu(). The caller must not hold
6783 * any locks which would prevent @fn from completing.
6784 *
6785 * Return: The value @fn returns.
6786 */
6787long work_on_cpu_safe_key(int cpu, long (*fn)(void *),
6788 void *arg, struct lock_class_key *key)
6789{
6790 long ret = -ENODEV;
6791
6792 cpus_read_lock();
6793 if (cpu_online(cpu))
6794 ret = work_on_cpu_key(cpu, fn, arg, key);
6795 cpus_read_unlock();
6796 return ret;
6797}
6798EXPORT_SYMBOL_GPL(work_on_cpu_safe_key);
6799#endif /* CONFIG_SMP */6774#endif /* CONFIG_SMP */
6800 6775
6801#ifdef CONFIG_FREEZER6776#ifdef CONFIG_FREEZER

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