From patchwork Tue Sep 25 08:21:25 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Dong Hao X-Patchwork-Id: 1502711 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 23855DF28C for ; Tue, 25 Sep 2012 08:22:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753810Ab2IYIVm (ORCPT ); Tue, 25 Sep 2012 04:21:42 -0400 Received: from e06smtp12.uk.ibm.com ([195.75.94.108]:55272 "EHLO e06smtp12.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753536Ab2IYIVk (ORCPT ); Tue, 25 Sep 2012 04:21:40 -0400 Received: from /spool/local by e06smtp12.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 25 Sep 2012 09:21:38 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) by e06smtp12.uk.ibm.com (192.168.101.142) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 25 Sep 2012 09:21:31 +0100 Received: from d06av07.portsmouth.uk.ibm.com (d06av07.portsmouth.uk.ibm.com [9.149.37.248]) by b06cxnps4075.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q8P8LNDu57737242; Tue, 25 Sep 2012 08:21:23 GMT Received: from d06av07.portsmouth.uk.ibm.com (d06av07.portsmouth.uk.ibm.com [127.0.0.1]) by d06av07.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q8P7mCw9029338; Tue, 25 Sep 2012 03:48:13 -0400 Received: from don-ThinkPad-T61.cn.ibm.com (don-thinkpad-t61.cn.ibm.com [9.123.159.39]) by d06av07.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q8P7mAYS029190; Tue, 25 Sep 2012 03:48:10 -0400 From: Dong Hao To: acme@infradead.org Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, xiaoguangrong@linux.vnet.ibm.com, runzhen@linux.vnet.ibm.com, Dong Hao Subject: =?UTF-8?q?=5BPATCH=5D=20fix=20compilation=20error=20of=20perf/core?= Date: Tue, 25 Sep 2012 16:21:25 +0800 Message-Id: <1348561285-25587-1-git-send-email-haodong@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.2.5 MIME-Version: 1.0 x-cbid: 12092508-8372-0000-0000-000003D64EC1 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Dong Hao The newest branch of perf/core should have compilation error! Error log includes: builtin-test.c: In function ‘perf_evsel__test_field’: builtin-test.c:1216:6: error: variable ‘ret’ set but not used [-Werror=unused-but-set-variable] builtin-test.c: In function ‘perf_evsel__tp_sched_test’: builtin-test.c:1242:6: error: variable ‘ret’ set but not used [-Werror=unused-but-set-variable] cc1: all warnings being treated as errors make: *** [builtin-test.o] Error 1 --------------------------------------------------------------------- Fix it by replacing return value from 0 to ret. Then this branch can be compiled successfully. Signed-off-by: Dong Hao --- tools/perf/builtin-test.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/perf/builtin-test.c b/tools/perf/builtin-test.c index 32caf13..78b47a7 100644 --- a/tools/perf/builtin-test.c +++ b/tools/perf/builtin-test.c @@ -1233,7 +1233,7 @@ static int perf_evsel__test_field(struct perf_evsel *evsel, const char *name, ret = -1; } - return 0; + return ret; } static int perf_evsel__tp_sched_test(void) @@ -1286,7 +1286,7 @@ static int perf_evsel__tp_sched_test(void) if (perf_evsel__test_field(evsel, "target_cpu", 4, true)) ret = -1; - return 0; + return ret; } static struct test {