[PATCH kernel-4.19 190/286] perf/x86/core: Refactor hw->idx checks and cleanup