perf/x86/intel/uncore: remove dead check
Subsystems (2)
PATCH 1/1 perf/x86/intel/uncore: remove dead check
pmu cannot be NULL as is taken as a pointer to an array. Remove the superfluous NULL check.
Found by Coverity: CID#1497507.
---
Cc: Peter Zijlstra <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Mark Rutland <[email protected]>
Cc: Alexander Shishkin <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Ian Rogers <[email protected]>
Cc: Adrian Hunter <[email protected]>
Cc: "Liang, Kan" <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: "H. Peter Anvin" <[email protected]>
Cc: [email protected]
Cc: [email protected]
--- arch/x86/events/intel/uncore.c | 2 -- 1 file changed, 2 deletions(-)
arch/x86/events/intel/uncore.c +0 -2
@@ -1325,8 +1325,6 @@ static void uncore_pci_sub_driver_init(void)continue ; pmu = &type->pmus[UNCORE_PCI_DEV_IDX (ids->driver_data)]; -if (!pmu) -continue ;if (uncore_pci_get_dev_die_info (pci_sub_dev, &die))continue ;
Signature · 1 line
2.51.1
[tip: perf/urgent] perf/x86/intel/uncore: Remove superfluous check
The following commit has been merged into the perf/urgent branch of tip:
The following commit has been merged into the perf/urgent branch of tip:
Commit-ID: a24074ca8840cf28fa50c40e957fdc50f29971b3 Gitweb: https://git.kernel.org/tip/a24074ca8840cf28fa50c40e957fdc50f29971b3 Author: Jiri Slaby (SUSE) <[email protected]> AuthorDate: Wed, 19 Nov 2025 10:15:38 +01:00 Committer: Ingo Molnar <[email protected]> CommitterDate: Wed, 19 Nov 2025 10:26:31 +01:00
perf/x86/intel/uncore: Remove superfluous check
The 'pmu' pointer cannot be NULL, as it is taken as a pointer to an array. Remove the superfluous NULL check.
Found by Coverity: CID#1497507.
--- arch/x86/events/intel/uncore.c | 2 -- 1 file changed, 2 deletions(-)
arch/x86/events/intel/uncore.c +0 -2
@@ -1325,8 +1325,6 @@ static void uncore_pci_sub_driver_init(void)continue ; pmu = &type->pmus[UNCORE_PCI_DEV_IDX (ids->driver_data)]; -if (!pmu) -continue ;if (uncore_pci_get_dev_die_info (pci_sub_dev, &die))continue ;
Quoted 32 lines · Jiri Slaby (SUSE)
pmu cannot be NULL as is taken as a pointer to an array. Remove the superfluous NULL check.
Found by Coverity: CID#1497507.
Signed-off-by Jiri Slaby (SUSE) <[email protected]>---
Cc: Peter Zijlstra <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Mark Rutland <[email protected]>
Cc: Alexander Shishkin <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Ian Rogers <[email protected]>
Cc: Adrian Hunter <[email protected]>
Cc: "Liang, Kan" <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: "H. Peter Anvin" <[email protected]>
Cc: [email protected]
Cc: [email protected]--- arch/x86/events/intel/uncore.c | 2 -- 1 file changed, 2 deletions(-)arch/x86/events/intel/uncore.c +0
-0
arch/x86/events/intel/uncore.c static void uncore_pci_sub_driver_init(void) · line 1330
Quoted 8 lines
arch/x86/events/intel/uncore.c +0
-2@@ -1325,8 +1325,6 @@ static void uncore_pci_sub_driver_init(void)continue ; pmu = &type->pmus[UNCORE_PCI_DEV_IDX (ids->driver_data)]; -if (!pmu) -continue ;if (uncore_pci_get_dev_die_info (pci_sub_dev, &die))continue ;
LGTM.
Quoted 41 lines · Dapeng
Quoted 38 lines · Jiri Slaby (SUSE)
pmu cannot be NULL as is taken as a pointer to an array. Remove the superfluous NULL check.
Found by Coverity: CID#1497507.
Signed-off-by Jiri Slaby (SUSE) <[email protected]>---
Cc: Peter Zijlstra <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Mark Rutland <[email protected]>
Cc: Alexander Shishkin <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Ian Rogers <[email protected]>
Cc: Adrian Hunter <[email protected]>
Cc: "Liang, Kan" <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: "H. Peter Anvin" <[email protected]>
Cc: [email protected]
Cc: [email protected]--- arch/x86/events/intel/uncore.c | 2 -- 1 file changed, 2 deletions(-)arch/x86/events/intel/uncore.c +0
-2@@ -1325,8 +1325,6 @@ static void uncore_pci_sub_driver_init(void)continue ; pmu = &type->pmus[UNCORE_PCI_DEV_IDX (ids->driver_data)]; -if (!pmu) -continue ;
Quoted 6 lines
arch/x86/events/intel/uncore.c static void uncore_pci_sub_driver_init(void) · line 1330
Quoted 2 lines
arch/x86/events/intel/uncore.c +0
-0if (uncore_pci_get_dev_die_info (pci_sub_dev, &die))continue ;LGTM.
Reviewed-by Dapeng Mi <[email protected]>
Thanks,
Ian