From 36d1c4540af3ef058d68092e41af05aa4a8c5eca Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Thu, 8 Mar 2018 18:48:26 +0100 Subject: all: fix gometalinter warnings Fix typos, non-canonical code, remove dead code, etc. --- sys/linux/386.go | 4 ++-- sys/linux/amd64.go | 4 ++-- sys/linux/arm.go | 4 ++-- sys/linux/arm64.go | 4 ++-- sys/linux/init_alg_test.go | 2 ++ sys/linux/init_iptables.go | 3 +-- sys/linux/ppc64le.go | 4 ++-- sys/linux/vnet.txt | 2 +- 8 files changed, 14 insertions(+), 13 deletions(-) (limited to 'sys/linux') diff --git a/sys/linux/386.go b/sys/linux/386.go index 25ebbe735..516320890 100644 --- a/sys/linux/386.go +++ b/sys/linux/386.go @@ -2852,7 +2852,7 @@ var structDescs_386 = []*KeyedStruct{ &CsumType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "csum", FldName: "csum", TypeSize: 2}, BigEndian: true}, Buf: "parent"}, &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "pointer", TypeSize: 1}}}, &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "length", TypeSize: 1}}}, - &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "unsed", TypeSize: 2}}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "unused", TypeSize: 2}}}, &StructType{Key: StructKey{Name: "icmp_ipv4_header"}, FldName: "iph"}, &BufferType{TypeCommon: TypeCommon{TypeName: "array", FldName: "data", IsVarlen: true}, Kind: 1, RangeEnd: 8}, }}}, @@ -25573,4 +25573,4 @@ var consts_386 = []ConstValue{ {Name: "bpf_insn_load_imm_dw", Value: 24}, } -const revision_386 = "a4d19f3d89c6652e30a30a8f16bb22eedea9571e" +const revision_386 = "8a515582f716e47c7187d6acd9ef3c3e8b30a7f9" diff --git a/sys/linux/amd64.go b/sys/linux/amd64.go index f3801be2a..42d311588 100644 --- a/sys/linux/amd64.go +++ b/sys/linux/amd64.go @@ -2938,7 +2938,7 @@ var structDescs_amd64 = []*KeyedStruct{ &CsumType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "csum", FldName: "csum", TypeSize: 2}, BigEndian: true}, Buf: "parent"}, &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "pointer", TypeSize: 1}}}, &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "length", TypeSize: 1}}}, - &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "unsed", TypeSize: 2}}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "unused", TypeSize: 2}}}, &StructType{Key: StructKey{Name: "icmp_ipv4_header"}, FldName: "iph"}, &BufferType{TypeCommon: TypeCommon{TypeName: "array", FldName: "data", IsVarlen: true}, Kind: 1, RangeEnd: 8}, }}}, @@ -26189,4 +26189,4 @@ var consts_amd64 = []ConstValue{ {Name: "bpf_insn_load_imm_dw", Value: 24}, } -const revision_amd64 = "0a160a2283a1e3ba08b37705ee1dbb6670b86af6" +const revision_amd64 = "d701f2a2142a12c08b17afbc15110c24f09bf0da" diff --git a/sys/linux/arm.go b/sys/linux/arm.go index 6dcfebac7..31fb52c01 100644 --- a/sys/linux/arm.go +++ b/sys/linux/arm.go @@ -2837,7 +2837,7 @@ var structDescs_arm = []*KeyedStruct{ &CsumType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "csum", FldName: "csum", TypeSize: 2}, BigEndian: true}, Buf: "parent"}, &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "pointer", TypeSize: 1}}}, &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "length", TypeSize: 1}}}, - &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "unsed", TypeSize: 2}}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "unused", TypeSize: 2}}}, &StructType{Key: StructKey{Name: "icmp_ipv4_header"}, FldName: "iph"}, &BufferType{TypeCommon: TypeCommon{TypeName: "array", FldName: "data", IsVarlen: true}, Kind: 1, RangeEnd: 8}, }}}, @@ -25294,4 +25294,4 @@ var consts_arm = []ConstValue{ {Name: "bpf_insn_load_imm_dw", Value: 24}, } -const revision_arm = "8f884a3256f4d0f2a84807391e479e7713ba6fac" +const revision_arm = "28772c035814f22d291032fc0d3a14c1ea6d4d34" diff --git a/sys/linux/arm64.go b/sys/linux/arm64.go index 94faf34f8..3ad3b1078 100644 --- a/sys/linux/arm64.go +++ b/sys/linux/arm64.go @@ -2938,7 +2938,7 @@ var structDescs_arm64 = []*KeyedStruct{ &CsumType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "csum", FldName: "csum", TypeSize: 2}, BigEndian: true}, Buf: "parent"}, &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "pointer", TypeSize: 1}}}, &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "length", TypeSize: 1}}}, - &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "unsed", TypeSize: 2}}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "unused", TypeSize: 2}}}, &StructType{Key: StructKey{Name: "icmp_ipv4_header"}, FldName: "iph"}, &BufferType{TypeCommon: TypeCommon{TypeName: "array", FldName: "data", IsVarlen: true}, Kind: 1, RangeEnd: 8}, }}}, @@ -25571,4 +25571,4 @@ var consts_arm64 = []ConstValue{ {Name: "bpf_insn_load_imm_dw", Value: 24}, } -const revision_arm64 = "a227f9eaa7342c1fc70e2518d7d2637f13f704b8" +const revision_arm64 = "32119668c79bbf78e86ee2739b37d2d06b458ff6" diff --git a/sys/linux/init_alg_test.go b/sys/linux/init_alg_test.go index b3622a6c9..d1c049d12 100644 --- a/sys/linux/init_alg_test.go +++ b/sys/linux/init_alg_test.go @@ -190,6 +190,8 @@ func testAlg(t *testing.T, typ, name string) (ok, skip bool) { const AF_ALG = 0x26 addr := &sockaddrAlg{ family: AF_ALG, + feat: 0, + mask: 0, } if len(typ) >= int(unsafe.Sizeof(addr.typ)) || len(name) >= int(unsafe.Sizeof(addr.name)) { diff --git a/sys/linux/init_iptables.go b/sys/linux/init_iptables.go index 86001b4c3..231bcfb77 100644 --- a/sys/linux/init_iptables.go +++ b/sys/linux/init_iptables.go @@ -64,9 +64,8 @@ func (arch *arch) generateNetfilterTable(g *prog.Gen, typ prog.Type, old prog.Ar // Assign the underflow entry once in a while. // We have it in underflow hooks, so no point in using it frequently. return pos - } else { - return offsets[g.Rand().Intn(len(offsets))] } + return offsets[g.Rand().Intn(len(offsets))] } // Assign offsets to used hooks. for hook := hookStart; hook < hookStart+hookCount; hook++ { diff --git a/sys/linux/ppc64le.go b/sys/linux/ppc64le.go index 2211ecd50..2c893c445 100644 --- a/sys/linux/ppc64le.go +++ b/sys/linux/ppc64le.go @@ -2932,7 +2932,7 @@ var structDescs_ppc64le = []*KeyedStruct{ &CsumType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "csum", FldName: "csum", TypeSize: 2}, BigEndian: true}, Buf: "parent"}, &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "pointer", TypeSize: 1}}}, &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "length", TypeSize: 1}}}, - &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "unsed", TypeSize: 2}}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "unused", TypeSize: 2}}}, &StructType{Key: StructKey{Name: "icmp_ipv4_header"}, FldName: "iph"}, &BufferType{TypeCommon: TypeCommon{TypeName: "array", FldName: "data", IsVarlen: true}, Kind: 1, RangeEnd: 8}, }}}, @@ -25333,4 +25333,4 @@ var consts_ppc64le = []ConstValue{ {Name: "bpf_insn_load_imm_dw", Value: 24}, } -const revision_ppc64le = "0a6ad6424c9561f4fddaeab2c50b92213fd76f79" +const revision_ppc64le = "83087ab2eb13cc0b1b58ad876c88d5c0920863c7" diff --git a/sys/linux/vnet.txt b/sys/linux/vnet.txt index 1b57b202f..b046c9733 100644 --- a/sys/linux/vnet.txt +++ b/sys/linux/vnet.txt @@ -1053,7 +1053,7 @@ icmp_parameter_prob_packet { csum csum[parent, inet, int16be] pointer int8 length int8 - unsed const[0, int16] + unused const[0, int16] iph icmp_ipv4_header data array[int8, 0:8] } [packed] -- cgit mrf-deployment