Annotate pm_runtime_resume_and_get() as __must_check ?
Seeing an erroneous use of pm_runtime_resume_and_get() in a patch I wonder whether we should annotate this function as __must_check. If the caller doesn't check the return code he doesn't know whether usage counter was bumped or not. Therefore I see a good chance that this results in a usage counter imbalance.
Quoted 6 lines · Heiner Kallweit
Seeing an erroneous use of
pm_runtime_resume_and_get()in a patch I wonder whether we should annotate this function as__must_check. If the caller doesn't check the return code he doesn't know whether usage counter was bumped or not. Therefore I see a good chance that this results in a usage counter imbalance.
Sounds reasonable. Please send a patch to make that change.
Quoted 9 lines · Rafael J. Wysocki
Quoted 6 lines · Heiner Kallweit
Seeing an erroneous use of
pm_runtime_resume_and_get()in a patch I wonder whether we should annotate this function as__must_check. If the caller doesn't check the return code he doesn't know whether usage counter was bumped or not. Therefore I see a good chance that this results in a usage counter imbalance.Sounds reasonable. Please send a patch to make that change.
It took some time to fix the callers that use pm_runtime_resume_and_get() w/o checking the return code. Last pending patch is [0], all other fixes are available on linux-next meanwhile.
I'll submit the patch to annotate pm_runtime_resume_and_get() as __must_check, so that we hopefully can get this into 5.17 (incl. pending [0]).