Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5009043imu; Sun, 25 Nov 2018 14:53:21 -0800 (PST) X-Google-Smtp-Source: AFSGD/URIGZ4VQPxLu+VcA69hX1HMYuI/eL33NmBHtBYeeF+Os8hLyIk8VUR03bbGOilkX5AQBgz X-Received: by 2002:a63:d252:: with SMTP id t18mr22457305pgi.133.1543186401703; Sun, 25 Nov 2018 14:53:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543186401; cv=none; d=google.com; s=arc-20160816; b=iqgiDVL5aICkZf5LfKvarfFR+YI6fmniKXeyq9p6oA2NhL7V+9nivj95fFMxBkUbzo FEEYVtUh8qpWw4NxQbQnrvbbXXAX5uSlDjzlxvG5l++Ths5m7FIToQn6jo+HW7z1xoLu jBUqu98DFjp7eRP7dnawz9h1u3waJrpEX/s4OBT82SuH3RgzcnmhtuUXtT8+VeAMzZ// JCM1nwq2iM5qEPqYLg/jQaP72/vozmkFchPbq3ArOeqWGZzoNr0e5VfB0zeCzsRcC7Dc xK9JXVztT4rJ3/A/JHGKwqjPRcrUKQxaA8nrR7N72no6gCfGV7qGfvx+B6QR2nmCtYUy KuuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=/7jn2dY0eXpQ+H2jsLGd0VISUlAYwO5O42O0KxD/Mms=; b=LZ/mI2CfoKpFp7xABbnkkkrEt/GLjcezp3oltDOT8iaf13cUbziGOZSi945lPo4zHl oXmjHNJLB43BEGgy3VqjGndd20lSnxXPLsG8i/96vHD/MgSq2fj56EBkhlKV66XUJieD 9sf9DC7ZSCf6w0MGZbca3uq6Y8VhfTNFftjNQddcXhakKSPWrPqNxa3PwdqY2gRGuFx3 oE3eNHoQcPZlz5eWb0TNazijm5CgqtGVkHfX/BLo0GTJ2/18PGRNzJqS/6QLP2gTcyjH S5ApdVM7fujqzalfq885/Qz+JglrBLeeBE7r4DLbAZrV2hEqAAp9x4tQT0NVjBqLYko4 XCmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lixom-net.20150623.gappssmtp.com header.s=20150623 header.b=WpN5+ScJ; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d18si59694095pgm.212.2018.11.25.14.53.06; Sun, 25 Nov 2018 14:53:21 -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=@lixom-net.20150623.gappssmtp.com header.s=20150623 header.b=WpN5+ScJ; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726154AbeKZJnj (ORCPT + 99 others); Mon, 26 Nov 2018 04:43:39 -0500 Received: from mail-pg1-f194.google.com ([209.85.215.194]:39967 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726025AbeKZJni (ORCPT ); Mon, 26 Nov 2018 04:43:38 -0500 Received: by mail-pg1-f194.google.com with SMTP id z10so5228877pgp.7 for ; Sun, 25 Nov 2018 14:51:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lixom-net.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=/7jn2dY0eXpQ+H2jsLGd0VISUlAYwO5O42O0KxD/Mms=; b=WpN5+ScJ/QWbqhC3k8pZqkKvjC6Ixob7TBoCVCUJdk43LtXKK356ZjzXV2/q31xnTG 6czyC99b7gpoW9AQJsNRPUbP45Fc9ESuUaULelhBe4qt41op8XrGLw0R64uOs+PVk/G8 Bd9O0hn5VJnOVSyXMoFWHHWEFcKZBBaCc7HlT5TdgPCjfEXmtejaWAR7YPtNlbQNIt40 JQMgxhaBbd4pYk8indEd6WqxDafT+FOTSOX+4D2OMy1Tg8zpi6wdtL8B6gIGLt/TgZNk ygrLNW1QeLnrIGDGmYL32+jtFsAaJqYg7RQZ0V1fw4qxa0vTc1aOw2U0qL5dXDzDLCzK cNNw== 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; bh=/7jn2dY0eXpQ+H2jsLGd0VISUlAYwO5O42O0KxD/Mms=; b=RQDX5dGEXGqZVi2xJZt54aCFQsf05skhhRfCXxjgUE0IEjnOcoNlWsNNWfTm9t8ieZ ZTHck4NrwWPoMDTdAv+3aHZmBXfumtdYSfWU0vz9DPInqL16qVbLtRUlZt5KoGGnBhqr QFDsxXvimxHt4onLrs5On4XtcMktd3JHQV3kL9Ftlu2eeQNLqtAs+LjFt90qIXb+aiPr TavZGaQEPtbfAHrk8D8o+Pxkyh/0zI1OUzcy++ZEGJcz8Sw5TH+OjG53J8QcD+8fUH6d NDLjxblqgsrwbcDfpgneeY0qNNuvtQ3eNy3sNijj2R15BWE0RDPVkFPt0wOC0Bx9wBmG dgVQ== X-Gm-Message-State: AA+aEWZRv1UQDFqQZTm9Z0wYvnRvSHsNZruRwYPU71l5qvwKrplP4tSc KtJ5sh7LKzQ8N2RhVaAjIGko8g== X-Received: by 2002:a63:4456:: with SMTP id t22mr23052921pgk.0.1543186287263; Sun, 25 Nov 2018 14:51:27 -0800 (PST) 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: Palmer Dabbelt , Albert Ou 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-Mailer: git-send-email 2.11.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; } -- 2.11.0