From: Paul Mundt Date: Thu, 5 Nov 2009 04:56:50 +0000 (+0900) Subject: sh: perf events: Fix up uninitialized variable warning. X-Git-Tag: firefly_0821_release~9833^2~3643^2~62^2~15 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=8820002c18cd3167d2800c002f13d78fa0325402;p=firefly-linux-kernel-4.4.55.git 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 --- diff --git a/arch/sh/kernel/perf_event.c b/arch/sh/kernel/perf_event.c index 4449f0ac9bf8..7ff0943e7a08 100644 --- a/arch/sh/kernel/perf_event.c +++ b/arch/sh/kernel/perf_event.c @@ -103,7 +103,7 @@ static int __hw_perf_event_init(struct perf_event *event) { struct perf_event_attr *attr = &event->attr; struct hw_perf_event *hwc = &event->hw; - int config; + int config = -1; int err; if (!sh_pmu_initialized()) @@ -155,8 +155,6 @@ static int __hw_perf_event_init(struct perf_event *event) config = sh_pmu->event_map(attr->config); break; - default: - return -EINVAL; } if (config == -1)