Skip to content

Commit 716eec0

Browse files
committed
Disable preempt count checking by default
1 parent 8632dfa commit 716eec0

5 files changed

Lines changed: 7 additions & 9 deletions

File tree

Cargo.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@ version = "0.1.0"
88
edition = "2024"
99
license = "MIT OR Apache-2.0"
1010

11-
[features]
12-
preempt_count = []
13-
default = ["preempt_count"]
14-
1511
[dependencies]
1612
rusqlite = "0.37"
1713
home = "0.5"

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,22 @@ nix run github:Rust-for-Linux/klint
3131

3232
## Run on Linux kernel
3333

34-
`klint`'s atomic context checker is not lint-clean on Linux kernel tree.
35-
If you would just like to use the `build_error` and stack frame size check feature, you can choose to disable atomic context checking when building `klint`:
3634
```console
37-
cargo install --path . --no-default-features
35+
cargo install --path .
3836
```
3937

4038
`klint` is a tool and would need to be registered with `rustc`, to do so, apply [this patch](doc/kernel.patch) to the kernel tree.
4139
This patch can be used even if plain rustc or clippy is used for kernel build.
4240

4341
To run this tool for Linux kernel build, use `make RUSTC=<path to klint>` to use klint in place of a Rust compiler.
4442

43+
`klint`'s atomic context checker is not lint-clean on Linux kernel tree.
44+
If you want to check it out, you can opt into it with `-Dklint::atomic_context`.
45+
4546
## Implemented Lints
4647

4748
* [Infallible allocation](doc/infallible_allocation.md)
4849
* [Atomic context](doc/atomic_context.md)
4950
* [`build_error` checks](doc/build_error.md)
5051
* [Stack frame size check](doc/stack_size.md)
52+
* [Prelude check](doc/not_using_prelude.md)

src/atomic_context.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ use crate::preempt_count::*;
6262

6363
declare_tool_lint! {
6464
pub klint::ATOMIC_CONTEXT,
65-
Deny,
65+
Allow,
6666
""
6767
}
6868

src/main.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@ impl Callbacks for MyCallbacks {
131131

132132
// lint_store
133133
// .register_late_pass(|_| Box::new(infallible_allocation::InfallibleAllocation));
134-
#[cfg(feature = "preempt_count")]
135134
lint_store.register_late_pass(|tcx| {
136135
Box::new(atomic_context::AtomicContext {
137136
cx: driver::cx::<MyCallbacks>(tcx),

tests/compile-test.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ fn run_ui_tests(bless: bool) {
2929
"-Zcrate-attr=register_tool(klint)",
3030
"--crate-type=lib",
3131
"-Zcrate-attr=no_std",
32+
"-Dklint::atomic_context",
3233
"--extern alloc",
3334
"--emit=obj",
3435
"-O",

0 commit comments

Comments
 (0)