Skip to content

Commit

Permalink
sh: perf events: Fix up uninitialized variable warning.
Browse files Browse the repository at this point in the history
'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>
  • Loading branch information
Paul Mundt committed Nov 5, 2009
1 parent b6d0137 commit 8820002
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions arch/sh/kernel/perf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 8820002

Please sign in to comment.