Page MenuHomeFreeBSD

LinuxKPI: pm.h add pm_sleep_ptr and DEFINE_SIMPLE_DEV_PM_OPS
ClosedPublic

Authored by bz on Nov 28 2022, 10:36 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 18 2024, 5:56 AM
Unknown Object (File)
Feb 29 2024, 4:22 PM
Unknown Object (File)
Feb 29 2024, 6:36 AM
Unknown Object (File)
Jan 10 2024, 9:02 PM
Unknown Object (File)
Dec 22 2023, 11:48 PM
Unknown Object (File)
Nov 27 2023, 3:33 AM
Unknown Object (File)
Nov 24 2023, 3:53 AM
Unknown Object (File)
Sep 30 2023, 7:14 PM

Details

Summary

Extend pm.h by pm_sleep_ptr and DEFINE_SIMPLE_DEV_PM_OPS().
Given this duplicates some parts I figured we could saves us the
as well.

MFC after: 3 days

Test Plan

I am still not sure what the difference between
DEFINE_SIMPLE_DEV_PM_OPS and SIMPLE_DEV_PM_OPS
is supposed to be or if we could define one to
the other. The fact that both exist made me keep
them separate for now.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

bz requested review of this revision.Nov 28 2022, 10:36 PM
hselasky added inline comments.
sys/compat/linuxkpi/common/include/linux/pm.h
55–58

Another way to do this:

#if IS_ENABLED(CONFIG_PM_SLEEP)
#define PM_SLEEP_PASS(...) __VA_ARGS__
#else
#define PM_SLEEP_PASS(...)
#endif

There is no point initializing something to NULL here.

60

Isn't IS_ENABLED() already expanding to something with ()'s Maybe you can unwrap it one time?

Unwrap (()) for pm_sleep_ptr

Restore #ifdef check to minialize changes to main (whitespace not retored).
Using the new macros probably was a silly idea indeed.

This revision is now accepted and ready to land.Nov 28 2022, 11:01 PM
sys/compat/linuxkpi/common/include/linux/pm.h
56

This macro is no longer used? Cleanup?

bz marked 3 inline comments as done.Nov 28 2022, 11:05 PM
bz added inline comments.
sys/compat/linuxkpi/common/include/linux/pm.h
56

it's still needed by a driver.

This revision was automatically updated to reflect the committed changes.
bz marked an inline comment as done.