Skip to content

Commit

Permalink
Merge pull request torvalds#418 from ojeda/deny
Browse files Browse the repository at this point in the history
Globally deny Clippy and `rust_2018_idioms`
  • Loading branch information
ojeda authored Jul 2, 2021
2 parents dcf2391 + b548e03 commit 8f77a98
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 19 deletions.
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,10 @@ KBUILD_RUSTCFLAGS := --emit=dep-info,obj,metadata --edition=2018 \
-Cpanic=abort -Cembed-bitcode=n -Clto=n -Crpath=n \
-Cforce-unwind-tables=n -Ccodegen-units=1 \
-Zbinary_dep_depinfo=y -Zsymbol-mangling-version=v0 \
-Dunsafe_op_in_unsafe_fn -Wmissing_docs
-Dunsafe_op_in_unsafe_fn -Drust_2018_idioms \
-Wmissing_docs
KBUILD_CLIPPYFLAGS := -Dclippy::correctness -Dclippy::style \
-Dclippy::complexity -Dclippy::perf
KBUILD_AFLAGS_KERNEL :=
KBUILD_CFLAGS_KERNEL :=
KBUILD_RUSTCFLAGS_KERNEL :=
Expand All @@ -539,7 +542,7 @@ CLANG_FLAGS :=

ifeq ($(KBUILD_CLIPPY),1)
RUSTC_OR_CLIPPY_QUIET := CLIPPY
RUSTC_OR_CLIPPY = $(CLIPPY_DRIVER)
RUSTC_OR_CLIPPY = $(CLIPPY_DRIVER) $(KBUILD_CLIPPYFLAGS)
else
RUSTC_OR_CLIPPY_QUIET := RUSTC
RUSTC_OR_CLIPPY = $(RUSTC)
Expand Down
2 changes: 1 addition & 1 deletion drivers/android/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ impl Node {
) {
out.ptr = self.ptr as _;
out.cookie = self.cookie as _;
let inner = self.inner.access(&guard);
let inner = self.inner.access(guard);
if inner.strong.has_count {
out.has_strong_ref = 1;
}
Expand Down
2 changes: 2 additions & 0 deletions drivers/android/rust_binder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
#![no_std]
#![feature(global_asm, try_reserve, allocator_api, concat_idents)]
// TODO: clean these up
#![allow(rust_2018_idioms)]

use alloc::{boxed::Box, sync::Arc};
use core::pin::Pin;
Expand Down
2 changes: 1 addition & 1 deletion drivers/char/hw_random/bcm2835_rng_rust.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ struct RngModule {
impl KernelModule for RngModule {
fn init() -> Result<Self> {
const OF_MATCH_TBL: ConstOfMatchTable<1> =
ConstOfMatchTable::new_const([&c_str!("brcm,bcm2835-rng")]);
ConstOfMatchTable::new_const([c_str!("brcm,bcm2835-rng")]);

let pdev = platdev::Registration::new_pinned::<RngDriver>(
c_str!("bcm2835-rng-rust"),
Expand Down
6 changes: 1 addition & 5 deletions rust/compiler_builtins.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@
#![compiler_builtins]
#![no_builtins]
#![no_std]
#![deny(clippy::complexity)]
#![deny(clippy::correctness)]
#![deny(clippy::perf)]
#![deny(clippy::style)]

macro_rules! define_panicking_intrinsics(
($reason: tt, { $($ident: ident, )* }) => {
Expand Down Expand Up @@ -143,7 +139,7 @@ extern "C" {
}

#[panic_handler]
fn panic(_info: &core::panic::PanicInfo) -> ! {
fn panic(_info: &core::panic::PanicInfo<'_>) -> ! {
unsafe {
rust_helper_BUG();
}
Expand Down
5 changes: 0 additions & 5 deletions rust/kernel/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@
receiver_trait,
try_reserve
)]
#![deny(clippy::complexity)]
#![deny(clippy::correctness)]
#![deny(clippy::perf)]
#![deny(clippy::style)]
#![deny(rust_2018_idioms)]

// Ensure conditional compilation based on the kernel configuration works;
// otherwise we may silently break things like initcall handling.
Expand Down
5 changes: 0 additions & 5 deletions rust/macros/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@

//! Crate for all kernel procedural macros.
#![deny(clippy::complexity)]
#![deny(clippy::correctness)]
#![deny(clippy::perf)]
#![deny(clippy::style)]

mod module;

use proc_macro::TokenStream;
Expand Down

0 comments on commit 8f77a98

Please sign in to comment.