diff options
| author | Aleksandr Nogikh <nogikh@google.com> | 2021-08-31 17:21:33 +0000 |
|---|---|---|
| committer | Aleksandr Nogikh <wp32pw@gmail.com> | 2021-09-22 15:40:02 +0200 |
| commit | 9e4e4272d3f686e750a13d2111b0fb7041db2f4a (patch) | |
| tree | 288c3421a8da52fcb7e460247f9678fece2ed1c9 /sys/linux/init.go | |
| parent | 169724fe58e8d7d0b4be6f59ca7c1e0f300399e1 (diff) | |
all: introduce a prog.Call constructor
Create a constructor for the prog.Call type. It allows to reduce
the duplication of code now and during further changes.
Diffstat (limited to 'sys/linux/init.go')
| -rw-r--r-- | sys/linux/init.go | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/sys/linux/init.go b/sys/linux/init.go index 1f9dcc2a7..24d978381 100644 --- a/sys/linux/init.go +++ b/sys/linux/init.go @@ -340,14 +340,10 @@ func (arch *arch) generateTimespec(g *prog.Gen, typ0 prog.Type, dir prog.Dir, ol }) var tpaddr prog.Arg tpaddr, calls = g.Alloc(ptrArgType, prog.DirIn, tp) - gettime := &prog.Call{ - Meta: meta, - Args: []prog.Arg{ - prog.MakeConstArg(meta.Args[0].Type, prog.DirIn, arch.CLOCK_REALTIME), - tpaddr, - }, - Ret: prog.MakeReturnArg(meta.Ret), - } + gettime := prog.MakeCall(meta, []prog.Arg{ + prog.MakeConstArg(meta.Args[0].Type, prog.DirIn, arch.CLOCK_REALTIME), + tpaddr, + }) calls = append(calls, gettime) sec := prog.MakeResultArg(typ.Fields[0].Type, dir, tp.Inner[0].(*prog.ResultArg), 0) nsec := prog.MakeResultArg(typ.Fields[1].Type, dir, tp.Inner[1].(*prog.ResultArg), 0) |
