Skip to content

Commit bc12167

Browse files
kolyshkinpcmoore
authored andcommitted
all: rm repetitive "type = iota"
In Go, one can omit repetitive "type = iota" stance. No functional change. Signed-off-by: Kir Kolyshkin <[email protected]> Signed-off-by: Paul Moore <[email protected]>
1 parent 025c011 commit bc12167

File tree

2 files changed

+41
-41
lines changed

2 files changed

+41
-41
lines changed

seccomp.go

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -134,46 +134,46 @@ const (
134134
// variables are invalid
135135
ArchInvalid ScmpArch = iota
136136
// ArchNative is the native architecture of the kernel
137-
ArchNative ScmpArch = iota
137+
ArchNative
138138
// ArchX86 represents 32-bit x86 syscalls
139-
ArchX86 ScmpArch = iota
139+
ArchX86
140140
// ArchAMD64 represents 64-bit x86-64 syscalls
141-
ArchAMD64 ScmpArch = iota
141+
ArchAMD64
142142
// ArchX32 represents 64-bit x86-64 syscalls (32-bit pointers)
143-
ArchX32 ScmpArch = iota
143+
ArchX32
144144
// ArchARM represents 32-bit ARM syscalls
145-
ArchARM ScmpArch = iota
145+
ArchARM
146146
// ArchARM64 represents 64-bit ARM syscalls
147-
ArchARM64 ScmpArch = iota
147+
ArchARM64
148148
// ArchMIPS represents 32-bit MIPS syscalls
149-
ArchMIPS ScmpArch = iota
149+
ArchMIPS
150150
// ArchMIPS64 represents 64-bit MIPS syscalls
151-
ArchMIPS64 ScmpArch = iota
151+
ArchMIPS64
152152
// ArchMIPS64N32 represents 64-bit MIPS syscalls (32-bit pointers)
153-
ArchMIPS64N32 ScmpArch = iota
153+
ArchMIPS64N32
154154
// ArchMIPSEL represents 32-bit MIPS syscalls (little endian)
155-
ArchMIPSEL ScmpArch = iota
155+
ArchMIPSEL
156156
// ArchMIPSEL64 represents 64-bit MIPS syscalls (little endian)
157-
ArchMIPSEL64 ScmpArch = iota
157+
ArchMIPSEL64
158158
// ArchMIPSEL64N32 represents 64-bit MIPS syscalls (little endian,
159159
// 32-bit pointers)
160-
ArchMIPSEL64N32 ScmpArch = iota
160+
ArchMIPSEL64N32
161161
// ArchPPC represents 32-bit POWERPC syscalls
162-
ArchPPC ScmpArch = iota
162+
ArchPPC
163163
// ArchPPC64 represents 64-bit POWER syscalls (big endian)
164-
ArchPPC64 ScmpArch = iota
164+
ArchPPC64
165165
// ArchPPC64LE represents 64-bit POWER syscalls (little endian)
166-
ArchPPC64LE ScmpArch = iota
166+
ArchPPC64LE
167167
// ArchS390 represents 31-bit System z/390 syscalls
168-
ArchS390 ScmpArch = iota
168+
ArchS390
169169
// ArchS390X represents 64-bit System z/390 syscalls
170-
ArchS390X ScmpArch = iota
170+
ArchS390X
171171
// ArchPARISC represents 32-bit PA-RISC
172-
ArchPARISC ScmpArch = iota
172+
ArchPARISC
173173
// ArchPARISC64 represents 64-bit PA-RISC
174-
ArchPARISC64 ScmpArch = iota
174+
ArchPARISC64
175175
// ArchRISCV64 represents RISCV64
176-
ArchRISCV64 ScmpArch = iota
176+
ArchRISCV64
177177
)
178178

179179
const (
@@ -184,32 +184,32 @@ const (
184184
ActInvalid ScmpAction = iota
185185
// ActKill kills the thread that violated the rule. It is the same as ActKillThread.
186186
// All other threads from the same thread group will continue to execute.
187-
ActKill ScmpAction = iota
187+
ActKill
188188
// ActTrap throws SIGSYS
189-
ActTrap ScmpAction = iota
189+
ActTrap
190190
// ActNotify triggers a userspace notification. This action is only usable when
191191
// libseccomp API level 6 or higher is supported.
192-
ActNotify ScmpAction = iota
192+
ActNotify
193193
// ActErrno causes the syscall to return a negative error code. This
194194
// code can be set with the SetReturnCode method
195-
ActErrno ScmpAction = iota
195+
ActErrno
196196
// ActTrace causes the syscall to notify tracing processes with the
197197
// given error code. This code can be set with the SetReturnCode method
198-
ActTrace ScmpAction = iota
198+
ActTrace
199199
// ActAllow permits the syscall to continue execution
200-
ActAllow ScmpAction = iota
200+
ActAllow
201201
// ActLog permits the syscall to continue execution after logging it.
202202
// This action is only usable when libseccomp API level 3 or higher is
203203
// supported.
204-
ActLog ScmpAction = iota
204+
ActLog
205205
// ActKillThread kills the thread that violated the rule. It is the same as ActKill.
206206
// All other threads from the same thread group will continue to execute.
207-
ActKillThread ScmpAction = iota
207+
ActKillThread
208208
// ActKillProcess kills the process that violated the rule.
209209
// All threads in the thread group are also terminated.
210210
// This action is only usable when libseccomp API level 3 or higher is
211211
// supported.
212-
ActKillProcess ScmpAction = iota
212+
ActKillProcess
213213
)
214214

215215
const (
@@ -222,23 +222,23 @@ const (
222222
CompareInvalid ScmpCompareOp = iota
223223
// CompareNotEqual returns true if the argument is not equal to the
224224
// given value
225-
CompareNotEqual ScmpCompareOp = iota
225+
CompareNotEqual
226226
// CompareLess returns true if the argument is less than the given value
227-
CompareLess ScmpCompareOp = iota
227+
CompareLess
228228
// CompareLessOrEqual returns true if the argument is less than or equal
229229
// to the given value
230-
CompareLessOrEqual ScmpCompareOp = iota
230+
CompareLessOrEqual
231231
// CompareEqual returns true if the argument is equal to the given value
232-
CompareEqual ScmpCompareOp = iota
232+
CompareEqual
233233
// CompareGreaterEqual returns true if the argument is greater than or
234234
// equal to the given value
235-
CompareGreaterEqual ScmpCompareOp = iota
235+
CompareGreaterEqual
236236
// CompareGreater returns true if the argument is greater than the given
237237
// value
238-
CompareGreater ScmpCompareOp = iota
238+
CompareGreater
239239
// CompareMaskedEqual returns true if the argument is equal to the given
240240
// value, when masked (bitwise &) against the second given value
241-
CompareMaskedEqual ScmpCompareOp = iota
241+
CompareMaskedEqual
242242
)
243243

244244
// ErrSyscallDoesNotExist represents an error condition where

seccomp_internal.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -270,11 +270,11 @@ type scmpFilterAttr uint32
270270

271271
const (
272272
filterAttrActDefault scmpFilterAttr = iota
273-
filterAttrActBadArch scmpFilterAttr = iota
274-
filterAttrNNP scmpFilterAttr = iota
275-
filterAttrTsync scmpFilterAttr = iota
276-
filterAttrLog scmpFilterAttr = iota
277-
filterAttrSSB scmpFilterAttr = iota
273+
filterAttrActBadArch
274+
filterAttrNNP
275+
filterAttrTsync
276+
filterAttrLog
277+
filterAttrSSB
278278
)
279279

280280
const (

0 commit comments

Comments
 (0)