Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

pkg/boot/bzimage: type should have the same receiver name #2916

Merged
merged 1 commit into from
Feb 16, 2024
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
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ linters-settings:
staticcheck:
checks: ["all", "-SA1006", "-SA1019", "-SA4003", "-SA4006", "-SA4016", "-SA5001", "-SA9004"]
stylecheck:
checks: ["all", "-ST1003", "-ST1016", "-ST1023"]
checks: ["all", "-ST1003", "-ST1023"]

issues:
exclude-rules:
Expand Down
12 changes: 6 additions & 6 deletions pkg/boot/bzimage/kver.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@
}

// KVer reads the kernel version string. See also: KVer() above.
func (bz *BzImage) KVer() (string, error) {
if bz.Header.Kveraddr == 0 {
func (b *BzImage) KVer() (string, error) {
if b.Header.Kveraddr == 0 {

Check warning on line 77 in pkg/boot/bzimage/kver.go

View check run for this annotation

Codecov / codecov/patch

pkg/boot/bzimage/kver.go#L76-L77

Added lines #L76 - L77 were not covered by tests
return "", ErrParse
}
start := uint64(bz.Header.Kveraddr + 0x200)
bclen := uint64(len(bz.BootCode))
hdrlen := uint64(bz.KernelOffset) - bclen
start := uint64(b.Header.Kveraddr + 0x200)
bclen := uint64(len(b.BootCode))
hdrlen := uint64(b.KernelOffset) - bclen

Check warning on line 82 in pkg/boot/bzimage/kver.go

View check run for this annotation

Codecov / codecov/patch

pkg/boot/bzimage/kver.go#L80-L82

Added lines #L80 - L82 were not covered by tests
bcoffs := start - hdrlen
if bcoffs >= bclen {
return "", ErrParse
Expand All @@ -88,7 +88,7 @@
if end > bclen {
end = bclen
}
return nullterm(bz.BootCode[bcoffs:end]), nil
return nullterm(b.BootCode[bcoffs:end]), nil

Check warning on line 91 in pkg/boot/bzimage/kver.go

View check run for this annotation

Codecov / codecov/patch

pkg/boot/bzimage/kver.go#L91

Added line #L91 was not covered by tests
}

// read c string from buffer
Expand Down
Loading