Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

kernel.h: add comments for enum system_states

Provide some basic comments about the system_states and what they imply.
Also convert the comments to kernel-doc format.

Split the enum declaration from the definition of the system_state
variable so that kernel-doc notation works cleanly with it. This is
picked up by Documentation/driver-api/basics.rst so it does not need
further inclusion in the kernel docbooks.

Link: https://lkml.kernel.org/r/20250907043857.2941203-1-rdunlap@infradead.org
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Acked-by: Rafael J. Wysocki <rafael@kernel.org> # v1
Reviewed-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> [v5]
Cc: "Brown, Len" <len.brown@intel.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: James Bottomley <james.bottomley@HansenPartnership.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Randy Dunlap and committed by
Andrew Morton
7b1e502e 913e65a2

+17 -4
+17 -4
include/linux/kernel.h
··· 164 164 165 165 extern bool early_boot_irqs_disabled; 166 166 167 - /* 168 - * Values used for system_state. Ordering of the states must not be changed 167 + /** 168 + * enum system_states - Values used for system_state. 169 + * 170 + * @SYSTEM_BOOTING: %0, no init needed 171 + * @SYSTEM_SCHEDULING: system is ready for scheduling; OK to use RCU 172 + * @SYSTEM_FREEING_INITMEM: system is freeing all of initmem; almost running 173 + * @SYSTEM_RUNNING: system is up and running 174 + * @SYSTEM_HALT: system entered clean system halt state 175 + * @SYSTEM_POWER_OFF: system entered shutdown/clean power off state 176 + * @SYSTEM_RESTART: system entered emergency power off or normal restart 177 + * @SYSTEM_SUSPEND: system entered suspend or hibernate state 178 + * 179 + * Note: 180 + * Ordering of the states must not be changed 169 181 * as code checks for <, <=, >, >= STATE. 170 182 */ 171 - extern enum system_states { 183 + enum system_states { 172 184 SYSTEM_BOOTING, 173 185 SYSTEM_SCHEDULING, 174 186 SYSTEM_FREEING_INITMEM, ··· 189 177 SYSTEM_POWER_OFF, 190 178 SYSTEM_RESTART, 191 179 SYSTEM_SUSPEND, 192 - } system_state; 180 + }; 181 + extern enum system_states system_state; 193 182 194 183 /* 195 184 * General tracing related utility functions - trace_printk(),