Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp567314ybz; Fri, 24 Apr 2020 05:34:30 -0700 (PDT) X-Google-Smtp-Source: APiQypIraHVhCtR86NNLaappBrmuS5XCfCHtjQ6uw+Oy9CcwIPP/z+0pNVuKaDA432eEFKbteOvY X-Received: by 2002:a17:906:5287:: with SMTP id c7mr7056644ejm.141.1587731670366; Fri, 24 Apr 2020 05:34:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587731670; cv=none; d=google.com; s=arc-20160816; b=snkt016JMdGKgb6OiLx2k1K1KXJ0b2N7KZoMZXDooNUxLJgSFlhKFO8RQiL1oTqK91 WeOWJnvQSwgpqwkYt+c+vZbb2n4N5FWIP8FrcoTUIpOb0kIcewjq+NwwBvbYRpcSF10/ GOB2tdHDUI+oWiRsSt9ibxBpogO4Fbm/r/jz5dJWb/pVVmF2UdX27qaor5568NkYQw/J co4l6r4wZwAZCwBy/PyE4gGVtfi14qlD20y4fN92THUIFWxT0gZCPJRnFpzf+m3vHp5g EAwSAkAnHr5MYnNRRvt61u1fUhhKkCUARcQLJaobPiYedVThIslfIvdXu6D+3P8o89iq l1nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=uq+5aY+XeVjCGdn8QjKtasEgm779U4SngC8mY0zwZZo=; b=HZm7qK+r4wzi/Tdo0KU1sKhQZ8eL6yn+l+QPfvSUDNMMDhpAtVSZ+a7C8Q67c56wc8 /2CnO1KC0si5wxwZXzbl5MBPiMVaBu9yWKMeEgwbEaCRKH9Y/J/XKENm3u97FFZo0qGQ /kShubJ4tc6lRESKCtxfSLCK2zi7D3prhYA0PFcuNg/t1n/yQDxvHIlqmFr8teiqTeHC 1Z8N0NyUO+102bxFE136VBuFPozGHIBWleTcCzUVY1XaelcnQEg7Rxl1W2ldM2dRtgGY k017iz3rYwSTiIUWPTuXfXzadlfgI8x/CGIKjZlRf/sk7KanK6Yf8ZZqyFbv0kkhQNCh k9gA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZrtCxDOp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t9si3056980edj.538.2020.04.24.05.34.07; Fri, 24 Apr 2020 05:34:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZrtCxDOp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728448AbgDXMbo (ORCPT + 99 others); Fri, 24 Apr 2020 08:31:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:52620 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727839AbgDXMXI (ORCPT ); Fri, 24 Apr 2020 08:23:08 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id EF31F2087E; Fri, 24 Apr 2020 12:23:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587730988; bh=WMY2KhaknJ6qcA8omuj0vvPzI9GIiw3E9kxGJCALNEE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZrtCxDOpOUzh6OPDnHVlLTPAk1srVA1xk3hOpLbZ02NvaHIwviMqJ5q9HfeTW4PDV ghrtstQX0Bgx/mSdRTLgYUyblupk49mVWD+7LgpgeZNCKMIDM2hFGsrkszE31otDRU XGY8/mi1kaVFRNixhJTifo3nEwpyneIWQHMzcenw= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Borislav Petkov , Peter Zijlstra , Ingo Molnar , Sasha Levin Subject: [PATCH AUTOSEL 5.6 27/38] sched/vtime: Work around an unitialized variable warning Date: Fri, 24 Apr 2020 08:22:25 -0400 Message-Id: <20200424122237.9831-27-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200424122237.9831-1-sashal@kernel.org> References: <20200424122237.9831-1-sashal@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Borislav Petkov [ Upstream commit e0d648f9d883ec1efab261af158d73aa30e9dd12 ] Work around this warning: kernel/sched/cputime.c: In function ‘kcpustat_field’: kernel/sched/cputime.c:1007:6: warning: ‘val’ may be used uninitialized in this function [-Wmaybe-uninitialized] because GCC can't see that val is used only when err is 0. Acked-by: Peter Zijlstra Signed-off-by: Borislav Petkov Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20200327214334.GF8015@zn.tnic Signed-off-by: Sasha Levin --- kernel/sched/cputime.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/sched/cputime.c b/kernel/sched/cputime.c index dac9104d126f7..ff9435dee1df2 100644 --- a/kernel/sched/cputime.c +++ b/kernel/sched/cputime.c @@ -1003,12 +1003,12 @@ u64 kcpustat_field(struct kernel_cpustat *kcpustat, enum cpu_usage_stat usage, int cpu) { u64 *cpustat = kcpustat->cpustat; + u64 val = cpustat[usage]; struct rq *rq; - u64 val; int err; if (!vtime_accounting_enabled_cpu(cpu)) - return cpustat[usage]; + return val; rq = cpu_rq(cpu); -- 2.20.1