From 888b8065ee1ed8d54b5e69b7b463cac176de188f Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Sat, 10 Sep 2022 12:43:37 +0200 Subject: syz-ci: simplify code Don't copy syzkaller files from one map to another. Probably a leftover from the times we used a temp slice or something. --- syz-ci/updater.go | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/syz-ci/updater.go b/syz-ci/updater.go index e9ba2c004..37519f45a 100644 --- a/syz-ci/updater.go +++ b/syz-ci/updater.go @@ -69,7 +69,7 @@ func NewSyzUpdater(cfg *Config) *SyzUpdater { osutil.MkdirAll(syzkallerDir) // List of required files in syzkaller build (contents of latest/current dirs). - files := map[string]bool{ + syzFiles := map[string]bool{ "tag": true, // contains syzkaller repo git hash "bin/syz-ci": true, // these are just copied from syzkaller dir "bin/syz-manager": true, @@ -80,16 +80,12 @@ func NewSyzUpdater(cfg *Config) *SyzUpdater { mgrcfg := mgr.managercfg os, vmarch, arch := mgrcfg.TargetOS, mgrcfg.TargetVMArch, mgrcfg.TargetArch targets[os+"/"+vmarch+"/"+arch] = true - files[fmt.Sprintf("bin/%v_%v/syz-fuzzer", os, vmarch)] = true - files[fmt.Sprintf("bin/%v_%v/syz-execprog", os, vmarch)] = true + syzFiles[fmt.Sprintf("bin/%v_%v/syz-fuzzer", os, vmarch)] = true + syzFiles[fmt.Sprintf("bin/%v_%v/syz-execprog", os, vmarch)] = true if mgrcfg.SysTarget.ExecutorBin == "" { - files[fmt.Sprintf("bin/%v_%v/syz-executor", os, arch)] = true + syzFiles[fmt.Sprintf("bin/%v_%v/syz-executor", os, arch)] = true } } - syzFiles := make(map[string]bool) - for f := range files { - syzFiles[f] = true - } compilerID, err := osutil.RunCmd(time.Minute, "", "go", "version") if err != nil { log.Fatalf("%v", err) -- cgit mrf-deployment