Skip to content

Commit

Permalink
cleanup(decl/syscalls): remove unused ret fields
Browse files Browse the repository at this point in the history
Signed-off-by: Leonardo Di Giovanna <[email protected]>
Co-authored-by: Aldo Lacuku <[email protected]>
  • Loading branch information
ekoops and alacuku committed Nov 19, 2024
1 parent 63f0cb7 commit b2912ca
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 22 deletions.
8 changes: 2 additions & 6 deletions pkg/test/step/syscall/finitmodule/finitmodule.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ type finitModuleSyscall struct {
bindOnlyArgs struct {
FD int `field_type:"fd"`
}
Ret int
// Return value is neither set nor bindable.
}

// New creates a new finit_module system call test step.
Expand All @@ -54,9 +54,5 @@ func New(name string, rawArgs map[string]string,
}

func (f *finitModuleSyscall) run(_ context.Context) error {
if err := unix.FinitModule(f.bindOnlyArgs.FD, f.args.ParamValues, f.args.Flags); err != nil {
return err
}

return nil
return unix.FinitModule(f.bindOnlyArgs.FD, f.args.ParamValues, f.args.Flags)
}
8 changes: 2 additions & 6 deletions pkg/test/step/syscall/initmodule/initmodule.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ type initModuleSyscall struct {
}
// bindOnlyArgs represents arguments that can only be provided by binding.
bindOnlyArgs struct{}
Ret int
// Return value is neither set nor bindable.
}

// New creates a new init_module system call test step.
Expand All @@ -51,9 +51,5 @@ func New(name string, rawArgs map[string]string,
}

func (i *initModuleSyscall) run(_ context.Context) error {
if err := unix.InitModule(i.args.ModuleImage, i.args.ParamValues); err != nil {
return err
}

return nil
return unix.InitModule(i.args.ModuleImage, i.args.ParamValues)
}
2 changes: 1 addition & 1 deletion pkg/test/step/syscall/link/link.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ type linkSyscall struct {
// bindOnlyArgs represents arguments that can only be provided by binding.
bindOnlyArgs struct{}
savedNewPath []byte
Ret int
// Return value is neither set nor bindable.
}

// New creates a new link system call test step.
Expand Down
2 changes: 1 addition & 1 deletion pkg/test/step/syscall/linkat/linkat.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ type linkAtSyscall struct {
NewDirFD int `field_type:"fd"`
}
savedNewPath []byte
Ret int
// Return value is neither set nor bindable.
}

// New creates a new linkat system call test step.
Expand Down
7 changes: 1 addition & 6 deletions pkg/test/step/syscall/sendto/sendto.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ type sendToSyscall struct {
// sendto system call returns the number of characters sent but both unix.Sendto and syscall.Sendto do not return
// it and do not allow to rewrite it by using direct calls to unix.Syscall or syscall.Syscall. For this reason, the
// returned value is currently neither set nor bindable.
Ret int
}

// New creates a new sendto system call test step.
Expand All @@ -63,9 +62,5 @@ func (s *sendToSyscall) run(_ context.Context) error {
if length == 0 {
length = len(s.args.Buf)
}
if err := unix.Sendto(s.bindOnlyArgs.FD, s.args.Buf[:length], s.args.Flags, s.args.DestAddr); err != nil {
return err
}

return nil
return unix.Sendto(s.bindOnlyArgs.FD, s.args.Buf[:length], s.args.Flags, s.args.DestAddr)
}
2 changes: 1 addition & 1 deletion pkg/test/step/syscall/symlink/symlink.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ type symlinkSyscall struct {
// bindOnlyArgs represents arguments that can only be provided by binding.
bindOnlyArgs struct{}
savedLinkPath []byte
Ret int
// Return value is neither set nor bindable.
}

// New creates a new symlink system call test step.
Expand Down
2 changes: 1 addition & 1 deletion pkg/test/step/syscall/symlinkat/symlinkat.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ type symlinkAtSyscall struct {
NewDirFD int `field_type:"fd"`
}
savedLinkPath []byte
Ret int
// Return value is neither set nor bindable.
}

// New creates a new symlinkat system call test step.
Expand Down

0 comments on commit b2912ca

Please sign in to comment.