linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Annotate pm_runtime_resume_and_get() as __must_check ?
@ 2021-07-31  9:08 Heiner Kallweit
  2021-08-03 13:07 ` Rafael J. Wysocki
  0 siblings, 1 reply; 3+ messages in thread
From: Heiner Kallweit @ 2021-07-31  9:08 UTC (permalink / raw)
  To: Rafael J. Wysocki; +Cc: Linux PM

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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Annotate pm_runtime_resume_and_get() as __must_check ?
  2021-07-31  9:08 Annotate pm_runtime_resume_and_get() as __must_check ? Heiner Kallweit
@ 2021-08-03 13:07 ` Rafael J. Wysocki
  2021-12-23  6:59   ` Heiner Kallweit
  0 siblings, 1 reply; 3+ messages in thread
From: Rafael J. Wysocki @ 2021-08-03 13:07 UTC (permalink / raw)
  To: Heiner Kallweit; +Cc: Rafael J. Wysocki, Linux PM

On Sat, Jul 31, 2021 at 11:36 AM Heiner Kallweit <hkallweit1@gmail.com> wrote:
>
> 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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Annotate pm_runtime_resume_and_get() as __must_check ?
  2021-08-03 13:07 ` Rafael J. Wysocki
@ 2021-12-23  6:59   ` Heiner Kallweit
  0 siblings, 0 replies; 3+ messages in thread
From: Heiner Kallweit @ 2021-12-23  6:59 UTC (permalink / raw)
  To: Rafael J. Wysocki, Herbert Xu
  Cc: Rafael J. Wysocki, Linux PM, Linux Crypto Mailing List

On 03.08.2021 15:07, Rafael J. Wysocki wrote:
> On Sat, Jul 31, 2021 at 11:36 AM Heiner Kallweit <hkallweit1@gmail.com> wrote:
>>
>> 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]).

[0] https://lore.kernel.org/all/ed1ac2f8-5259-684d-42c8-effdf2920e78@gmail.com/T/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-12-23  6:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-31  9:08 Annotate pm_runtime_resume_and_get() as __must_check ? Heiner Kallweit
2021-08-03 13:07 ` Rafael J. Wysocki
2021-12-23  6:59   ` Heiner Kallweit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).