Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

CI: Add clippy workflow #48

Merged
merged 4 commits into from
Dec 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ rustflags = [
rustflags = [
"-C", "link-arg=-Tsrc/arch/aarch64/link.ld"
]

[build]
target = "x86_64-unknown-hermit-loader.json"
27 changes: 27 additions & 0 deletions .github/workflows/clippy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Clippy

on:
push:
branches:
- master
- staging
- trying
pull_request:

env:
CARGO_TERM_COLOR: always

jobs:
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- name: Install NASM
run: |
sudo apt-get update
sudo apt-get install nasm
- uses: actions/checkout@v2
- name: Rustup (apply rust-toolchain.toml)
run: rustup show
- name: Clippy
run: cargo clippy -- -D warnings
1 change: 1 addition & 0 deletions bors.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
status = [
"Clippy",
"Test aarch64 (nightly)",
"Test x86_64 (ubuntu-latest, nightly)",
"Test x86_64 (macOS-latest, nightly)",
Expand Down
7 changes: 6 additions & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
[toolchain]
channel = "nightly-2021-12-04"
components = [ "rustfmt", "rust-src", "llvm-tools-preview"]
components = [
"clippy",
"llvm-tools-preview",
"rustfmt",
"rust-src",
]
8 changes: 4 additions & 4 deletions src/kernel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,12 @@ pub unsafe fn load_kernel(elf: &Elf<'_>, elf_start: u64, mem_size: u64) -> (Opti
);
} else if program_header.p_type == program_header::PT_TLS {
if elf.header.e_type == header::ET_DYN {
BOOT_INFO.tls_start = address + u64::from(program_header.p_vaddr);
BOOT_INFO.tls_start = address + program_header.p_vaddr;
} else {
BOOT_INFO.tls_start = program_header.p_vaddr.into();
BOOT_INFO.tls_start = program_header.p_vaddr;
}
BOOT_INFO.tls_filesz = program_header.p_filesz.into();
BOOT_INFO.tls_memsz = program_header.p_memsz.into();
BOOT_INFO.tls_filesz = program_header.p_filesz;
BOOT_INFO.tls_memsz = program_header.p_memsz;
BOOT_INFO.tls_align = program_header.p_align;

loaderlog!(
Expand Down