Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp769599rwi; Thu, 20 Oct 2022 05:10:46 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7tPs/+RFiDw/HTkvfUrWubLiQdb/aYc8x0zgd9MqsxDWLwdb9gG8JH8CO5xw/dv4zVFgL2 X-Received: by 2002:a17:907:1623:b0:78d:9e8b:171d with SMTP id hb35-20020a170907162300b0078d9e8b171dmr10591103ejc.309.1666267836255; Thu, 20 Oct 2022 05:10:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666267836; cv=none; d=google.com; s=arc-20160816; b=pdhEjoMsijiU51nUIOPaB3OiMaXFs7an2vQKcWMBAUuHRWrNikzW9VTu95u2GPP5UN VMU6l0z6Hrh39E4eOxSzzJKF+HeoXPV0m4HAShPcm0bDsVBM044nOTcqni8O7ChudVZ5 LEo9JB0ZQUvhCOmfjxwecZApn5/E6UYavBHkTfTEKv7DHiSOjztqZscR9yDuZPL3NygA DWirgea+ZzVvV35IXJwyFCL64RCHEY2LN1/ZBaIrKt+rj2mVd034k91vj1JFLxQILbHc Jk0YGEs+4litT/DlxEVYxK9+1MJ0EA7yAlzA6v8itCFBFEITUkZynKu5VNA85aO4EfT4 UClg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=bOeIQs06Ph1bJ91eHAC9fBVgauw5j59B8/KvO9VWdAY=; b=U6RjxuiOq05Kvy3ky3InkVyXPvu3RFBPipcyIhE+RUcNXqjFMcArwTlkh3rlHw04Y/ L1anLTgJKDFm8Xzhejt6mR0RSlDx+IXYlGevYGiEhJKjzr1Tmdm1GVABu0+4WoJvfxG+ zx+iqFJt/r4FMu+Ba8PUeX0uJvJthLE5TfazNhTIQj/VjY/vyeeTp1zO1PLHLJYS50sw So+9yiTTIdlWWxRYuWc3pAzWqGJAi0sX6WSBZLBulH1QLJU5MQ7wxn05/db3RNhtZVG9 V02mdyJfHrc2gLUqyPoAcZe5jr7tClIzyBN1nBD3cKZophGX78fzzrZYJIPCS7KNcytN XnJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=PBpvCe+e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d21-20020a170906345500b0078d2f0bf546si12939854ejb.186.2022.10.20.05.10.09; Thu, 20 Oct 2022 05:10:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=PBpvCe+e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231425AbiJTLig (ORCPT + 99 others); Thu, 20 Oct 2022 07:38:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42454 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231407AbiJTLia (ORCPT ); Thu, 20 Oct 2022 07:38:30 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D8C9D1DEC01 for ; Thu, 20 Oct 2022 04:38:03 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 92DE21FCFA; Thu, 20 Oct 2022 11:38:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1666265881; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=bOeIQs06Ph1bJ91eHAC9fBVgauw5j59B8/KvO9VWdAY=; b=PBpvCe+eKaNf8bwyjdesNestAeyQ6jmQl9dMvpuhLdQXjqPFo9p9VBZgDru/8YYuiEsJmQ M0a4vZAgkjF5JxMl8e5xw+lL3Gdm19fY3NtK8sbry4qXU0+EZFADAIQWui+2pHnFqOrQMh DHvIn+IF35Oa8nHjrGVNSMG5sLUEBEI= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 4090D13494; Thu, 20 Oct 2022 11:38:01 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id REBlDhkzUWPEBgAAMHmgww (envelope-from ); Thu, 20 Oct 2022 11:38:01 +0000 From: Juergen Gross To: linux-kernel@vger.kernel.org, x86@kernel.org Cc: Juergen Gross , Boris Ostrovsky , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , xen-devel@lists.xenproject.org, Dan Carpenter Subject: [PATCH] x86/xen: silence smatch warning in pmu_msr_chk_emulated() Date: Thu, 20 Oct 2022 13:37:59 +0200 Message-Id: <20221020113759.17402-1-jgross@suse.com> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit 8714f7bcd3c2 ("xen/pv: add fault recovery control to pmu msr accesses") introduced code resulting in a warning issued by the smatch static checker, claiming to use an uninitialized variable. This is a false positive, but work around the warning nevertheless. Fixes: 8714f7bcd3c2 ("xen/pv: add fault recovery control to pmu msr accesses") Reported-by: Dan Carpenter Signed-off-by: Juergen Gross --- arch/x86/xen/pmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/xen/pmu.c b/arch/x86/xen/pmu.c index 68aff1382872..898a252ed6f1 100644 --- a/arch/x86/xen/pmu.c +++ b/arch/x86/xen/pmu.c @@ -302,7 +302,7 @@ static bool xen_amd_pmu_emulate(unsigned int msr, u64 *val, bool is_read) static bool pmu_msr_chk_emulated(unsigned int msr, uint64_t *val, bool is_read, bool *emul) { - int type, index; + int type = 0, index = 0; if (is_amd_pmu_msr(msr)) *emul = xen_amd_pmu_emulate(msr, val, is_read); -- 2.35.3