mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 06:44:00 -04:00
rust: bump Clippy's MSRV and clean incompatible_msrv allows
Following the Rust compiler bump, we can now update Clippy's MSRV we set in the configuration, which will improve the diagnostics it generates. Thus do so and clean a few of the `allow`s that are not needed anymore. Reviewed-by: Tamir Duberstein <tamird@kernel.org> Acked-by: Danilo Krummrich <dakr@kernel.org> Reviewed-by: Gary Guo <gary@garyguo.net> Link: https://patch.msgid.link/20260405235309.418950-7-ojeda@kernel.org Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
# SPDX-License-Identifier: GPL-2.0
|
# SPDX-License-Identifier: GPL-2.0
|
||||||
|
|
||||||
msrv = "1.78.0"
|
msrv = "1.85.0"
|
||||||
|
|
||||||
check-private-items = true
|
check-private-items = true
|
||||||
|
|
||||||
|
|||||||
@@ -281,7 +281,6 @@ impl DmaGspMem {
|
|||||||
let (slice_1, slice_2) = {
|
let (slice_1, slice_2) = {
|
||||||
let (slice_1, slice_2) = self.driver_write_area();
|
let (slice_1, slice_2) = self.driver_write_area();
|
||||||
|
|
||||||
#[allow(clippy::incompatible_msrv)]
|
|
||||||
(slice_1.as_flattened_mut(), slice_2.as_flattened_mut())
|
(slice_1.as_flattened_mut(), slice_2.as_flattened_mut())
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -572,10 +571,7 @@ impl Cmdq {
|
|||||||
Delta::from_millis(1),
|
Delta::from_millis(1),
|
||||||
timeout,
|
timeout,
|
||||||
)
|
)
|
||||||
.map(|(slice_1, slice_2)| {
|
.map(|(slice_1, slice_2)| (slice_1.as_flattened(), slice_2.as_flattened()))?;
|
||||||
#[allow(clippy::incompatible_msrv)]
|
|
||||||
(slice_1.as_flattened(), slice_2.as_flattened())
|
|
||||||
})?;
|
|
||||||
|
|
||||||
// Extract the `GspMsgElement`.
|
// Extract the `GspMsgElement`.
|
||||||
let (header, slice_1) = GspMsgElement::from_bytes_prefix(slice_1).ok_or(EIO)?;
|
let (header, slice_1) = GspMsgElement::from_bytes_prefix(slice_1).ok_or(EIO)?;
|
||||||
|
|||||||
@@ -81,7 +81,6 @@ impl Alignment {
|
|||||||
/// This is equivalent to [`align_of`], but with the return value provided as an [`Alignment`].
|
/// This is equivalent to [`align_of`], but with the return value provided as an [`Alignment`].
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
pub const fn of<T>() -> Self {
|
pub const fn of<T>() -> Self {
|
||||||
#![allow(clippy::incompatible_msrv)]
|
|
||||||
// This cannot panic since alignments are always powers of two.
|
// This cannot panic since alignments are always powers of two.
|
||||||
//
|
//
|
||||||
// We unfortunately cannot use `new` as it would require the `generic_const_exprs` feature.
|
// We unfortunately cannot use `new` as it would require the `generic_const_exprs` feature.
|
||||||
|
|||||||
@@ -49,7 +49,6 @@ pub unsafe trait FromBytes {
|
|||||||
let slice_ptr = bytes.as_ptr().cast::<Self>();
|
let slice_ptr = bytes.as_ptr().cast::<Self>();
|
||||||
let size = size_of::<Self>();
|
let size = size_of::<Self>();
|
||||||
|
|
||||||
#[allow(clippy::incompatible_msrv)]
|
|
||||||
if bytes.len() == size && slice_ptr.is_aligned() {
|
if bytes.len() == size && slice_ptr.is_aligned() {
|
||||||
// SAFETY: Size and alignment were just checked.
|
// SAFETY: Size and alignment were just checked.
|
||||||
unsafe { Some(&*slice_ptr) }
|
unsafe { Some(&*slice_ptr) }
|
||||||
@@ -92,7 +91,6 @@ pub unsafe trait FromBytes {
|
|||||||
let slice_ptr = bytes.as_mut_ptr().cast::<Self>();
|
let slice_ptr = bytes.as_mut_ptr().cast::<Self>();
|
||||||
let size = size_of::<Self>();
|
let size = size_of::<Self>();
|
||||||
|
|
||||||
#[allow(clippy::incompatible_msrv)]
|
|
||||||
if bytes.len() == size && slice_ptr.is_aligned() {
|
if bytes.len() == size && slice_ptr.is_aligned() {
|
||||||
// SAFETY: Size and alignment were just checked.
|
// SAFETY: Size and alignment were just checked.
|
||||||
unsafe { Some(&mut *slice_ptr) }
|
unsafe { Some(&mut *slice_ptr) }
|
||||||
|
|||||||
Reference in New Issue
Block a user