Skip to content

arch: Fix Clippy lints for CPUID updates - #202

Merged
scholzp merged 1 commit into
cyberus-technology:gardenlinuxfrom
scholzp:fix_clippy
Sep 3, 2026
Merged

scholzp merged 1 commit into
cyberus-technology:gardenlinuxfrom
scholzp:fix_clippy

Conversation

@scholzp

@scholzp scholzp commented Sep 3, 2026

Copy link
Copy Markdown

Weird that that the CI didn't catch it some days ago. I found this when executing Clippy locally on my machine.

This fixes lints of the following kind:

error: this `if` can be collapsed into the outer `match`
   --> arch/src/x86_64/mod.rs:874:17
    |
874 | /                 if !config.amx {
875 | |                     if entry.index == 0 {
876 | |                         entry.edx &= !((1 << AMX_BF16) | (1 << AMX_TILE) | (1 << AMX_INT8));
...   |
882 | |                 }
    | |_________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match
    = note: `-D clippy::collapsible-match` implied by `-D clippy::all`
    = help: to override `-D clippy::all` add `#[allow(clippy::collapsible_match)]`
help: collapse nested if block
    |
873 ~             0x7
874 ~                 if !config.amx => {
875 |                     if entry.index == 0 {
...
881 |                     }
882 ~                 }
    |

This fixes lints of the following kind:
```
error: this `if` can be collapsed into the outer `match`
   --> arch/src/x86_64/mod.rs:874:17
    |
874 | /                 if !config.amx {
875 | |                     if entry.index == 0 {
876 | |                         entry.edx &= !((1 << AMX_BF16) | (1 << AMX_TILE) | (1 << AMX_INT8));
...   |
882 | |                 }
    | |_________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match
    = note: `-D clippy::collapsible-match` implied by `-D clippy::all`
    = help: to override `-D clippy::all` add `#[allow(clippy::collapsible_match)]`
help: collapse nested if block
    |
873 ~             0x7
874 ~                 if !config.amx => {
875 |                     if entry.index == 0 {
...
881 |                     }
882 ~                 }
    |
```

On-behalf-of: SAP pascal.scholz@sap.com
Signed-off-by: Pascal Scholz <pascal.scholz@cyberus-technology.de>
@scholzp scholzp self-assigned this Sep 3, 2026

@olivereanderson olivereanderson left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@phip1611

phip1611 commented Sep 3, 2026

Copy link
Copy Markdown
Member

Weird that that the CI didn't catch it some days ago. I found this when executing Clippy locally on my machine.

clippy frequently changes, probably different versions in use

@scholzp
scholzp merged commit 616807d into cyberus-technology:gardenlinux Sep 3, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants