From patchwork Tue Feb 12 17:16:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 158175 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp4090057jaa; Tue, 12 Feb 2019 09:17:36 -0800 (PST) X-Google-Smtp-Source: AHgI3Ibs+eNlmIYYv9m6SvhdrVXHjPSLzEOAkPE2ujdmblIoZCyVzAf9nOuVuDQKxxWSe98r1jOb X-Received: by 2002:a17:902:bc89:: with SMTP id bb9mr5053148plb.212.1549991856850; Tue, 12 Feb 2019 09:17:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549991856; cv=none; d=google.com; s=arc-20160816; b=fsOW+4FB1/NkutPa3ggha8QsTk/0zJ07brGkqZvyFhs5wqq7WqNChnedf50OEsi/+z wUV3QMQvMKLFdAJtwqIJx9JoSSstIqTgDTeNIH2WFu/1xkBrZUYqdYtWZYVbXSNqERmM F9GMaAVj4KeeslKX59Lce9riGmEKnwv7Ga+Xeu6N50hwsE3M2cesmEGeMLoMch2UA2RZ tNenjospT52qT6pTC1GiBW6YQmM74EOJNMXaTKwOGglTsazCmTiDp8XqdKw6eBDZEVxg ErTGnca2Mv2itDlN7FOme63RZgfcvkS0AN31Lhuxp8Yx6stAbAhyLU3UmE0Ewdd7hx/m PicQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=/lnWMMCIsg4/tFUsl2j1cd75JRahCaG7A5ViWQnd0OY=; b=R9iGPFRV7xX1jf7qJuCN5fWTIodfziD1wJLTRcBwpNyArArwUxNgBAMoyerrvMherc d9m8GZ67jGqe/bueBQRtnOpDcO/jAXl6Y+DgqvfWfyYTkhx9DiFMJMf+Ea+m3iAdmgFl dY8kFcIZ9msCam0wIuy06Yugd/cbtDU3OuaiIWRG9gyfZ2uzq7qWCTksn4x6Gxmn/cGi nmnd9jDc5eWk0/FiORzU51NxLDehyciOUMklSGhBZE66UohPyvhJGH7rfumdWnYMQJz2 o9w9AGJ8s8fFr2A4KFKvQXyH5qCbeYka3OpIJazs7Qc4itze33MLVovGsjiACsd0b1qC dmIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nvD3sPQV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i2si13168746plt.69.2019.02.12.09.17.36; Tue, 12 Feb 2019 09:17:36 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nvD3sPQV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730240AbfBLRRe (ORCPT + 31 others); Tue, 12 Feb 2019 12:17:34 -0500 Received: from mail-pl1-f193.google.com ([209.85.214.193]:45128 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729807AbfBLRQY (ORCPT ); Tue, 12 Feb 2019 12:16:24 -0500 Received: by mail-pl1-f193.google.com with SMTP id r14so1584407pls.12 for ; Tue, 12 Feb 2019 09:16:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=/lnWMMCIsg4/tFUsl2j1cd75JRahCaG7A5ViWQnd0OY=; b=nvD3sPQVTmPup1RY7P6dkHQg3RQbopWaNl2R7n0ekAHhDAV5NE/q69+aIzpOmXe6XU IcwLyhmnoL2lS90lSvUSI/ta9vrDvlC1/Ub3O/uynQAv0zL3YY+dqzL2GZ3Yw8m49APy +OzEmV3koMukBg5tYr/x0HFN3dTnYQuSOy0JH9M2qBzjO9DMzqagpMDhG/GBa8f247iQ gAz0RJOK0D+R30EfucoL6waUOOzflugJpiWEJATPoMRo61FvUY8AnX9CnnQWTuAYsnN6 SZfaOJBeasDCJpcvhKRJYeqCXl7sKm7S+utqmOCNtl5qcQqPoucR/aXS4Zu03+DOsAYY v19g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=/lnWMMCIsg4/tFUsl2j1cd75JRahCaG7A5ViWQnd0OY=; b=PLXTjCX5HiBX3/3i2mJYdJvxGC2WjXNc2qyfvVIB/KGVxPF8GOFiTUj0bWG2fOE2WI RIZbxYhpEVD82FWiW/S3d2aNeinZ8dfZ6YMHpoq2r1i8JMWxqs9C5Xr8eUuCHEYni63R LOW3H8kMAQJvmfHGE3lBrwxRlcEoKFvCtUPs03J5JX5iMuoo4VfKUIAy0P8aMb4JTpcQ tm2b+q4r9/ubeZo4P27Ar3mK1fAuL7v2HGUL6WXRjlT79AF9Sg4BWaMmzLJg6hN0Tf8z HJgn2044WGfwDrrutC19QYD/naw1PIdbni1fx136Hzm3rwmY5IWdvqS24LDRMcLyDHlz h14Q== X-Gm-Message-State: AHQUAub/Z8+vcdgoDFJM4TDAJ5n34ddT0YkmDIq5QfqjlPvok3Ik1rZd aE+76zbCOImofkJgA9/PcUpngg== X-Received: by 2002:a17:902:9884:: with SMTP id s4mr4777634plp.1.1549991783804; Tue, 12 Feb 2019 09:16:23 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id z4sm8659231pgu.10.2019.02.12.09.16.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Feb 2019 09:16:23 -0800 (PST) From: Mathieu Poirier To: acme@kernel.org Cc: suzuki.poulose@arm.com, mingo@redhat.com, peterz@infradead.org, jolsa@redhat.com, leo.yan@linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 03/13] perf tools: Fix wrong return values in error path Date: Tue, 12 Feb 2019 10:16:08 -0700 Message-Id: <20190212171618.25355-4-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190212171618.25355-1-mathieu.poirier@linaro.org> References: <20190212171618.25355-1-mathieu.poirier@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Function cs_etm__mem_access() is supposed to return a u32 but the error path returns negative values at a couple of places, something that really throws off the clients using it. Fix the situation by return '0'. Signed-off-by: Mathieu Poirier --- tools/perf/util/cs-etm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.17.1 diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c index 1d9419a0cf0c..f396fee9bb95 100644 --- a/tools/perf/util/cs-etm.c +++ b/tools/perf/util/cs-etm.c @@ -324,7 +324,7 @@ static u32 cs_etm__mem_access(struct cs_etm_queue *etmq, u64 address, struct addr_location al; if (!etmq) - return -1; + return 0; machine = etmq->etm->machine; cpumode = cs_etm__cpu_mode(etmq, address); @@ -332,7 +332,7 @@ static u32 cs_etm__mem_access(struct cs_etm_queue *etmq, u64 address, thread = etmq->thread; if (!thread) { if (cpumode != PERF_RECORD_MISC_KERNEL) - return -EINVAL; + return 0; thread = etmq->etm->unknown_thread; }