From patchwork Sun Nov 25 22:51:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olof Johansson X-Patchwork-Id: 10699195 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 35D3515A7 for ; Mon, 26 Nov 2018 21:32:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2253D2A623 for ; Mon, 26 Nov 2018 21:32:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1541D2A626; Mon, 26 Nov 2018 21:32:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,MIME_HEADER_CTYPE_ONLY,RCVD_IN_DNSWL_LOW, T_TVD_MIME_NO_HEADERS autolearn=no version=3.3.1 Received: from web01.groups.io (web01.groups.io [66.175.222.12]) (using TLSv1.2 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A1F532A623 for ; Mon, 26 Nov 2018 21:32:57 +0000 (UTC) X-Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by groups.io with SMTP; Mon, 26 Nov 2018 13:32:56 -0800 X-Received: by mail.kernel.org (Postfix) id E9793208E7; Mon, 26 Nov 2018 21:32:55 +0000 (UTC) X-Received: from mail-lf1-f67.google.com (mail-lf1-f67.google.com [209.85.167.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 842C92082F for ; Mon, 26 Nov 2018 21:32:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 842C92082F X-Received: by mail-lf1-f67.google.com with SMTP id l10so14756607lfh.9 for ; Mon, 26 Nov 2018 13:32:55 -0800 (PST) X-Gm-Message-State: AGRZ1gJzB1+wMY+RqjgdiXo2DmsPNZluAmrYeyQw0PcCmnA9fVK183fw Bau5MdpM0cIVmQ44+BIhpQoAK8Pgt/NVUg== X-Google-Smtp-Source: AJdET5dBrsI/aT5QCKfO+8qRRGjpZ/T7fuV8Z8fZtmea71iejP+xi3SDDZ7uPwbQhULgWGSJEh7kkg== X-Received: by 2002:a19:1a14:: with SMTP id a20mr16165285lfa.1.1543267973282; Mon, 26 Nov 2018 13:32:53 -0800 (PST) X-Received: from localhost (h85-30-9-151.cust.a3fiber.se. [85.30.9.151]) by smtp.gmail.com with ESMTPSA id a25sm231460lfk.31.2018.11.26.13.32.52 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 26 Nov 2018 13:32:52 -0800 (PST) Resent-From: Olof Johansson Resent-Date: Mon, 26 Nov 2018 13:32:44 -0800 Resent-Message-ID: <20181126213244.ayloixlut3na7zky@localhost> Resent-To: soc-patchwork@kernel.org X-Received: from rip.lixom.net (99-152-116-91.lightspeed.sntcca.sbcglobal.net. [99.152.116.91]) by smtp.gmail.com with ESMTPSA id u137sm88976473pfc.140.2018.11.25.14.51.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 25 Nov 2018 14:51:26 -0800 (PST) From: Olof Johansson To: Linuxkernel+Patchwork-Soc via Email Integration Cc: linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, Olof Johansson Subject: [PATCH] riscv: perf: fix build warning Date: Sun, 25 Nov 2018 14:51:21 -0800 Message-Id: <20181125225121.4454-1-olof@lixom.net> X-TUID: ADY31vrioxBo Precedence: Bulk List-Unsubscribe: Sender: patchwork-soc@linux.kernel.org List-Id: Mailing-List: list patchwork-soc@linux.kernel.org; contact patchwork-soc+owner@linux.kernel.org Delivered-To: mailing list patchwork-soc@linux.kernel.org Reply-To: patchwork-soc+owner@linux.kernel.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux.kernel.org; q=dns/txt; s=20140610; t=1543267977; bh=+qGzrfEtIG65Exe1E2FD4St86kfQIAaJ7NccxG9x0Tw=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=vpKq4Apa/lRM02ArJG+sEwRBGcObpMsN8QOM656AG734ueWZpXH7qgNvuCvZe0pBs8c 2EOlzcDYgHqXRlYrBMCpFqEKMOZADotY+BCfi87LSjb3uhndQ41ZAbBiR70cnP1FOE+ON yY4hJssoOPkBNRSaTPik7ls0OL+kY5GX8Qg= X-Virus-Scanned: ClamAV using ClamSMTP Due to the -ENOENT return, the variables can't actually be used uninitialized, but the compiler isn't smart enough in this case. Let's just set them before returning with the error for now, it'll be filled in once implemented. arch/riscv/kernel/perf_event.c:166:5: warning: 'type' may be used uninitialized in this function [-Wmaybe-uninitialized] arch/riscv/kernel/perf_event.c:166:38: warning: 'op' may be used uninitialized in this function [-Wmaybe-uninitialized] arch/riscv/kernel/perf_event.c:167:39: warning: 'result' may be used uninitialized in this function [-Wmaybe-uninitialized] Signed-off-by: Olof Johansson --- I swear I posted this exact fix just last week, but can't find a reference to it anywhere. arch/riscv/kernel/perf_event.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/riscv/kernel/perf_event.c b/arch/riscv/kernel/perf_event.c index a243fae1c1dbb..81f3ba76f1dbc 100644 --- a/arch/riscv/kernel/perf_event.c +++ b/arch/riscv/kernel/perf_event.c @@ -150,6 +150,9 @@ static int riscv_map_hw_event(u64 config) int riscv_map_cache_decode(u64 config, unsigned int *type, unsigned int *op, unsigned int *result) { + *type = 0; + *op = 0; + *result = 0; return -ENOENT; }