aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKris Alder <kalder@google.com>2023-10-19 08:40:37 -0700
committerAleksandr Nogikh <nogikh@google.com>2023-10-19 17:06:09 +0000
commita42250d2817c29e8c9b5617612ba366dfe55cba1 (patch)
tree56e534af48ef2c0442d8b47faa55727bb1c07aaf
parent4f9b680bf7d56a0023c4ec0e87207c77de7d276a (diff)
syz-ci: remove unneeded if statements
filepath.Join() will ignore empty parameters, so we don't need these checks.
-rw-r--r--syz-ci/jobs.go5
-rw-r--r--syz-ci/manager.go6
-rw-r--r--syz-ci/syz-ci.go2
3 files changed, 3 insertions, 10 deletions
diff --git a/syz-ci/jobs.go b/syz-ci/jobs.go
index d8092ad0e..8e40ddab7 100644
--- a/syz-ci/jobs.go
+++ b/syz-ci/jobs.go
@@ -365,10 +365,7 @@ func (jp *JobProcessor) process(job *Job) *dashapi.JobDoneReq {
mgrcfg := new(mgrconfig.Config)
*mgrcfg = *mgr.managercfg
mgrcfg.Workdir = filepath.Join(dir, "workdir")
- mgrcfg.KernelSrc = filepath.Join(dir, "kernel")
- if mgr.mgrcfg.KernelSrcSuffix != "" {
- mgrcfg.KernelSrc = filepath.Join(dir, "kernel", mgr.mgrcfg.KernelSrcSuffix)
- }
+ mgrcfg.KernelSrc = filepath.Join(dir, "kernel", mgr.mgrcfg.KernelSrcSuffix)
mgrcfg.Syzkaller = filepath.Join(dir, "gopath", "src", "github.com", "google", "syzkaller")
os.RemoveAll(mgrcfg.Workdir)
defer os.RemoveAll(mgrcfg.Workdir)
diff --git a/syz-ci/manager.go b/syz-ci/manager.go
index b1746184a..84bfbe9bb 100644
--- a/syz-ci/manager.go
+++ b/syz-ci/manager.go
@@ -127,7 +127,7 @@ func createManager(cfg *Config, mgrcfg *ManagerConfig, stop chan struct{},
mgr := &Manager{
name: mgrcfg.managercfg.Name,
workDir: filepath.Join(dir, "workdir"),
- kernelDir: kernelDir,
+ kernelDir: path.Join(kernelDir, mgrcfg.KernelSrcSuffix),
currentDir: filepath.Join(dir, "current"),
latestDir: filepath.Join(dir, "latest"),
configTag: hash.String(configData),
@@ -143,10 +143,6 @@ func createManager(cfg *Config, mgrcfg *ManagerConfig, stop chan struct{},
debug: debug,
}
- if mgrcfg.KernelSrcSuffix != "" {
- mgr.kernelDir = path.Join(kernelDir, mgrcfg.KernelSrcSuffix)
- }
-
os.RemoveAll(mgr.currentDir)
return mgr, nil
}
diff --git a/syz-ci/syz-ci.go b/syz-ci/syz-ci.go
index 7beb6ad88..00035a6ce 100644
--- a/syz-ci/syz-ci.go
+++ b/syz-ci/syz-ci.go
@@ -178,7 +178,7 @@ type ManagerConfig struct {
Ccache string `json:"ccache"`
Userspace string `json:"userspace"`
KernelConfig string `json:"kernel_config"`
- // KernelSrcSuffiz adds a suffix to the kernel_src manager config. This is needed for cases where
+ // KernelSrcSuffix adds a suffix to the kernel_src manager config. This is needed for cases where
// the kernel source root as reported in the coverage UI is a subdirectory of the VCS root.
KernelSrcSuffix string `json:"kernel_src_suffix"`
// Build-type-specific parameters.