Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sh: perf events: Fix up uninitialized variable warning.

'config' can be unintialized, and although it's not really an error, it
still manages to trigger the -Werror with certain toolchains. Initialize
it early to shut up gcc.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>

+1 -3
+1 -3
arch/sh/kernel/perf_event.c
··· 103 103 { 104 104 struct perf_event_attr *attr = &event->attr; 105 105 struct hw_perf_event *hwc = &event->hw; 106 - int config; 106 + int config = -1; 107 107 int err; 108 108 109 109 if (!sh_pmu_initialized()) ··· 155 155 156 156 config = sh_pmu->event_map(attr->config); 157 157 break; 158 - default: 159 - return -EINVAL; 160 158 } 161 159 162 160 if (config == -1)