notifier: Add atomic_notifier_call_chain_is_empty()
authorDmitry Osipenko <dmitry.osipenko@collabora.com>
Thu, 19 May 2022 11:02:32 +0000 (14:02 +0300)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 19 May 2022 17:25:06 +0000 (19:25 +0200)
commit13dfd97a341a5cf9d15f415dd469f45e971ef12a
tree956f0adb0fd184cc3fc9ea45e990f47bfccfa56c
parent42226c989789d8da4af1de0c31070c96726d990c
notifier: Add atomic_notifier_call_chain_is_empty()

Add atomic_notifier_call_chain_is_empty() that returns true if given
atomic call chain is empty.

The first user of this new notifier API function will be the kernel
power-off core code that will support power-off call chains. The core
code will need to check whether there is a power-off handler registered
at all in order to decide whether to halt machine or power it off.

Reviewed-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
include/linux/notifier.h
kernel/notifier.c