scripts/coccinelle/api/pm_runtime.cocci
Source file repositories/reference/linux-study-clean/scripts/coccinelle/api/pm_runtime.cocci
File Facts
- System
- Linux kernel
- Corpus path
scripts/coccinelle/api/pm_runtime.cocci- Extension
.cocci- Size
- 2428 bytes
- Lines
- 114
- Domain
- Support Tooling And Documentation
- Bucket
- scripts
- Inferred role
- Support Tooling And Documentation: scripts
- Status
- atlas-only
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
Dependency Surface
- No C-style include directives detected by the generator.
Detected Declarations
- No top-level syscall, struct, function, initcall, or export declaration detected by the generator.
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
/// Make sure pm_runtime_* calls do not unnecessarily use IS_ERR_VALUE
///
// Keywords: pm_runtime
// Confidence: Medium
// Copyright (C) 2013 Texas Instruments Incorporated -
// URL: https://coccinelle.gitlabpages.inria.fr/website
// Options: --include-headers
virtual patch
virtual context
virtual org
virtual report
//----------------------------------------------------------
// Detection
//----------------------------------------------------------
@runtime_bad_err_handle exists@
expression ret;
position p;
@@
(
ret@p = \(pm_runtime_idle\|
pm_runtime_suspend\|
pm_runtime_autosuspend\|
pm_runtime_resume\|
pm_request_idle\|
pm_request_resume\|
pm_request_autosuspend\|
pm_runtime_get\|
pm_runtime_get_sync\|
pm_runtime_put\|
pm_runtime_put_autosuspend\|
pm_runtime_put_sync\|
pm_runtime_put_sync_suspend\|
pm_runtime_put_sync_autosuspend\|
pm_runtime_set_active\|
pm_schedule_suspend\|
pm_generic_runtime_suspend\|
pm_generic_runtime_resume\)(...);
...
IS_ERR_VALUE(ret)
...
)
//----------------------------------------------------------
// For context mode
//----------------------------------------------------------
@depends on context@
identifier pm_runtime_api;
expression ret;
position runtime_bad_err_handle.p;
@@
(
ret@p = pm_runtime_api(...);
...
* IS_ERR_VALUE(ret)
...
)
//----------------------------------------------------------
// For patch mode
//----------------------------------------------------------
@depends on patch@
identifier pm_runtime_api;
expression ret;
position runtime_bad_err_handle.p;
Annotation
- Atlas domain: Support Tooling And Documentation / scripts.
- Implementation status: atlas-only.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.