Fix some unecessary unsafe warnings#183
Draft
tych0 wants to merge 1 commit intovirtee:mainfrom
Draft
Conversation
warning: unnecessary `unsafe` block
--> src/processor.rs:40:21
|
40 | let cpuid = unsafe { x86_64::__cpuid(0x8000_0001) };
| ^^^^^^ unnecessary `unsafe` block
|
= note: `#[warn(unused_unsafe)]` (part of `#[warn(unused)]`) on by default
warning: unnecessary `unsafe` block
--> src/ok.rs:105:27
|
105 | let res = unsafe { x86_64::__cpuid(0x0000_0000) };
| ^^^^^^ unnecessary `unsafe` block
warning: unnecessary `unsafe` block
--> src/ok.rs:129:45
|
129 | ... let cpuid = unsafe { x86_64::__cpuid(cpuid) };
| ^^^^^^ unnecessary `unsafe` block
warning: unnecessary `unsafe` block
--> src/ok.rs:161:35
|
161 | let res = unsafe { x86_64::__cpuid(0x8000_001f) };
| ^^^^^^ unnecessary `unsafe` block
warning: unnecessary `unsafe` block
--> src/ok.rs:186:35
|
186 | let res = unsafe { x86_64::__cpuid(0x8000_001f) };
| ^^^^^^ unnecessary `unsafe` block
warning: unnecessary `unsafe` block
--> src/ok.rs:211:43
|
211 | ... let res = unsafe { x86_64::__cpuid(0x8000_001f) };
| ^^^^^^ unnecessary `unsafe` block
warning: unnecessary `unsafe` block
--> src/ok.rs:242:43
|
242 | ... let res = unsafe { x86_64::__cpuid(0x8000_001f) };
| ^^^^^^ unnecessary `unsafe` block
warning: unnecessary `unsafe` block
--> src/ok.rs:261:51
|
261 | ... let res = unsafe { x86_64::__cpuid(0x8000_001f) };
| ^^^^^^ unnecessary `unsafe` block
warning: unnecessary `unsafe` block
--> src/ok.rs:279:55
|
279 | ... let res = unsafe { x86_64::__cpuid(0x8000_001f) };
| ^^^^^^ unnecessary `unsafe` block
warning: unnecessary `unsafe` block
--> src/ok.rs:328:43
|
328 | ... let res = unsafe { x86_64::__cpuid(0x8000_001f) };
| ^^^^^^ unnecessary `unsafe` block
warning: unnecessary `unsafe` block
--> src/ok.rs:343:43
|
343 | ... let res = unsafe { x86_64::__cpuid(0x8000_001f) };
| ^^^^^^ unnecessary `unsafe` block
warning: unnecessary `unsafe` block
--> src/ok.rs:358:43
|
358 | ... let res = unsafe { x86_64::__cpuid(0x8000_001f) };
| ^^^^^^ unnecessary `unsafe` block
warning: unnecessary `unsafe` block
--> src/ok.rs:374:43
|
374 | ... let res = unsafe { x86_64::__cpuid(0x8000_001f) };
| ^^^^^^ unnecessary `unsafe` block
warning: unnecessary `unsafe` block
--> src/ok.rs:405:35
|
405 | let res = unsafe { x86_64::__cpuid(0x8000_001f) };
| ^^^^^^ unnecessary `unsafe` block
warning: `snphost` (bin "snphost") generated 14 warnings
Signed-off-by: Tycho Andersen (AMD) <tycho@kernel.org>
Author
|
Ah, seems this hasn't made it to stable yet :( |
Member
We likely can't accept this until stable supports the feature. Perhaps you can make this a draft PR, and mark as ready when it reaches stable? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
warning: unnecessary
unsafeblock--> src/processor.rs:40:21
|
40 | let cpuid = unsafe { x86_64::__cpuid(0x8000_0001) };
| ^^^^^^ unnecessary
unsafeblock|
= note:
#[warn(unused_unsafe)](part of#[warn(unused)]) on by defaultwarning: unnecessary
unsafeblock--> src/ok.rs:105:27
|
105 | let res = unsafe { x86_64::__cpuid(0x0000_0000) };
| ^^^^^^ unnecessary
unsafeblockwarning: unnecessary
unsafeblock--> src/ok.rs:129:45
|
129 | ... let cpuid = unsafe { x86_64::__cpuid(cpuid) };
| ^^^^^^ unnecessary
unsafeblockwarning: unnecessary
unsafeblock--> src/ok.rs:161:35
|
161 | let res = unsafe { x86_64::__cpuid(0x8000_001f) };
| ^^^^^^ unnecessary
unsafeblockwarning: unnecessary
unsafeblock--> src/ok.rs:186:35
|
186 | let res = unsafe { x86_64::__cpuid(0x8000_001f) };
| ^^^^^^ unnecessary
unsafeblockwarning: unnecessary
unsafeblock--> src/ok.rs:211:43
|
211 | ... let res = unsafe { x86_64::__cpuid(0x8000_001f) };
| ^^^^^^ unnecessary
unsafeblockwarning: unnecessary
unsafeblock--> src/ok.rs:242:43
|
242 | ... let res = unsafe { x86_64::__cpuid(0x8000_001f) };
| ^^^^^^ unnecessary
unsafeblockwarning: unnecessary
unsafeblock--> src/ok.rs:261:51
|
261 | ... let res = unsafe { x86_64::__cpuid(0x8000_001f) };
| ^^^^^^ unnecessary
unsafeblockwarning: unnecessary
unsafeblock--> src/ok.rs:279:55
|
279 | ... let res = unsafe { x86_64::__cpuid(0x8000_001f) };
| ^^^^^^ unnecessary
unsafeblockwarning: unnecessary
unsafeblock--> src/ok.rs:328:43
|
328 | ... let res = unsafe { x86_64::__cpuid(0x8000_001f) };
| ^^^^^^ unnecessary
unsafeblockwarning: unnecessary
unsafeblock--> src/ok.rs:343:43
|
343 | ... let res = unsafe { x86_64::__cpuid(0x8000_001f) };
| ^^^^^^ unnecessary
unsafeblockwarning: unnecessary
unsafeblock--> src/ok.rs:358:43
|
358 | ... let res = unsafe { x86_64::__cpuid(0x8000_001f) };
| ^^^^^^ unnecessary
unsafeblockwarning: unnecessary
unsafeblock--> src/ok.rs:374:43
|
374 | ... let res = unsafe { x86_64::__cpuid(0x8000_001f) };
| ^^^^^^ unnecessary
unsafeblockwarning: unnecessary
unsafeblock--> src/ok.rs:405:35
|
405 | let res = unsafe { x86_64::__cpuid(0x8000_001f) };
| ^^^^^^ unnecessary
unsafeblockwarning:
snphost(bin "snphost") generated 14 warnings