treewide: remove unnecessary types and conversions
Change-Id: Ifcaa9ceeec243b3646c9b6e0a6fad7ef2db8fd90
Reviewed-on: https://review.monogon.dev/c/monogon/+/2954
Reviewed-by: Lorenz Brun <lorenz@monogon.tech>
Tested-by: Jenkins CI
diff --git a/metropolis/pkg/verity/encoder.go b/metropolis/pkg/verity/encoder.go
index e0124e2..a1c0ca1 100644
--- a/metropolis/pkg/verity/encoder.go
+++ b/metropolis/pkg/verity/encoder.go
@@ -212,8 +212,8 @@
// Get the padding size by substracting current offset from a hash block
// size.
- co := int(binary.Size(sb))
- pbc := int(sb.hashBlockSize) - int(co)
+ co := binary.Size(sb)
+ pbc := int(sb.hashBlockSize) - co
if pbc <= 0 {
return int64(co), fmt.Errorf("hash device block size smaller than dm-verity superblock")
}
@@ -326,8 +326,8 @@
t.HashDevicePath,
strconv.FormatUint(uint64(t.superblock.dataBlockSize), 10),
strconv.FormatUint(uint64(t.superblock.hashBlockSize), 10),
- strconv.FormatUint(uint64(t.superblock.dataBlocks), 10),
- strconv.FormatInt(int64(t.HashStart), 10),
+ strconv.FormatUint(t.superblock.dataBlocks, 10),
+ strconv.FormatInt(t.HashStart, 10),
t.superblock.algorithmName(),
hex.EncodeToString(t.rootHash),
hex.EncodeToString(t.superblock.salt()),