From d6cdfb8a765c64793bc63cf630e68fbdd0ee0974 Mon Sep 17 00:00:00 2001 From: Taras Madan Date: Fri, 20 Jun 2025 12:04:24 +0200 Subject: pkg/report: minor refactoring setExecutorInfo is closer to Report. Distinguish reportType and defaultReportType Make setter a Report member function. --- pkg/report/linux.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'pkg/report/linux.go') diff --git a/pkg/report/linux.go b/pkg/report/linux.go index 782cb9032..3d03671bd 100644 --- a/pkg/report/linux.go +++ b/pkg/report/linux.go @@ -188,10 +188,10 @@ func (ctx *linux) Parse(output []byte) *Report { } rep.reportPrefixLen = len(rep.Report) rep.Report = append(rep.Report, report...) - setReportType(rep, oops, format) - ctx.setExecutorInfo(rep) + rep.setType(format.reportType, oops.defaultReportType) + setExecutorInfo(rep) if !rep.Corrupted { - rep.Corrupted, rep.CorruptedReason = ctx.isCorrupted(title, report, format) + rep.Corrupted, rep.CorruptedReason = isCorrupted(title, report, format) } if rep.CorruptedReason == corruptedNoFrames && context != contextConsole && !questionable { // We used to look at questionable frame with the following incentive: @@ -898,7 +898,7 @@ func getMaintainersImpl(kernelSrc, file string, blame bool) (vcs.Recipients, err return vcs.ParseMaintainersLinux(output), nil } -func (ctx *linux) isCorrupted(title string, report []byte, format oopsFormat) (bool, string) { +func isCorrupted(title string, report []byte, format oopsFormat) (bool, string) { // Check for common title corruptions. for _, re := range linuxCorruptedTitles { if re.MatchString(title) { @@ -954,7 +954,7 @@ func (ctx *linux) isCorrupted(title string, report []byte, format oopsFormat) (b var syzLinuxCommRe = regexp.MustCompile(` Comm: syz\.(\d+)\.(\d+) `) -func (ctx *linux) setExecutorInfo(rep *Report) { +func setExecutorInfo(rep *Report) { match := syzLinuxCommRe.FindSubmatch(rep.Report) if match == nil { return -- cgit mrf-deployment