From patchwork Thu Aug 17 00:26:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li zeming X-Patchwork-Id: 135663 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a888:0:b0:3f2:4152:657d with SMTP id x8csp450631vqo; Tue, 15 Aug 2023 07:03:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH31nasezVGr74nsigIahglZLe2WNbnCaFI3kSNJbcTLbQ1Jnd3m864d5SrwMOlsPyanvu/ X-Received: by 2002:a17:906:10dc:b0:99d:73f1:e507 with SMTP id v28-20020a17090610dc00b0099d73f1e507mr11221026ejv.41.1692108183677; Tue, 15 Aug 2023 07:03:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692108183; cv=none; d=google.com; s=arc-20160816; b=NSY5B4O/qakt2LcqqIvtmXfeRpORPWu6R6GpMrDNz9c5i/p57qHp1fH5sHIgS6mZLA zQ4ok6R21Nbwx2ampfH234RiruKjiNvYEUv3NGj7pTeaibHynJFGuOs7oZhK2/x22qyK ah1rvn5mmcDDuEx0eVddnrWSpVrRysrLhWzfnZA4efQmrlMJBUiWsAxoOCgtudMUMaNE JLr0+ZcMo2RvwQf87RVO+b1cRyoXwByzTaxUL4VThZ+hWBBr9NfY1AVja3zSwsDLbffK 0ttq34p5n3DV4FHqCtti0kNziYc7NQeRRI0p5QiqWv04xdnvPaA34TuzxIqzb1REBMbY +KoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=3bDjTNZPUN+4l5z/qJXnfYAdx4uhmRGhuU+VqhAUc+E=; fh=IoUF6y7XmMu+X/UOYo8X+vkNPh5kwjE5ke/ivkao5Gk=; b=yxDztyLUx1JUAGD0Nyk4J/uOPgmaWhZOMd7sOxWbvZQ5S2wvHsQiyMfHlz/1pq8ip3 X8STNxDGwRR6agnzMdTXco+JzA8hfZtJCI15W5eT5ElBG9N8/O0WoLvWNqtI/8tBu8Vs s7lozZOU+S/iDIUfte8S6O6wDXN2pjYadXEqScM/GsswvB9q7EwMXXzRv7jx4wS6S2yo Ak3/aDRwDD8BtUaP8KzUujWem7mNfYA5Ev1NKMkgy+5IYgpk+UsAguu4tkmBgIh2tQD+ FcsUs3qEt4teFMivQLG0ndvl2vtC54AGW3RkJp611d9TBZHlfnyny1t6zudOctI21YVw vhqA== ARC-Authentication-Results: i=1; mx.google.com; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ot13-20020a170906cccd00b0098295eed929si9003883ejb.998.2023.08.15.07.02.13; Tue, 15 Aug 2023 07:03:03 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235486AbjHOH4N (ORCPT + 99 others); Tue, 15 Aug 2023 03:56:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235485AbjHOH4B (ORCPT ); Tue, 15 Aug 2023 03:56:01 -0400 Received: from mail.nfschina.com (unknown [42.101.60.195]) by lindbergh.monkeyblade.net (Postfix) with SMTP id 237EADD; Tue, 15 Aug 2023 00:55:58 -0700 (PDT) Received: from localhost.localdomain (unknown [219.141.250.2]) by mail.nfschina.com (Maildata Gateway V2.8.8) with ESMTPA id 8116460280B60; Tue, 15 Aug 2023 15:55:16 +0800 (CST) X-MD-Sfrom: zeming@nfschina.com X-MD-SrcIP: 219.141.250.2 From: Li zeming To: seanjc@google.com, pbonzini@redhat.com, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com Cc: x86@kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Li zeming Subject: [PATCH] x86: kvm: x86: Remove unnecessary initial values of variables Date: Thu, 17 Aug 2023 08:26:31 +0800 Message-Id: <20230817002631.2885-1-zeming@nfschina.com> X-Mailer: git-send-email 2.18.2 X-Spam-Status: No, score=0.9 required=5.0 tests=BAYES_00,DATE_IN_FUTURE_24_48, RDNS_NONE,SPF_HELO_NONE,SPF_PASS autolearn=no 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1774304031035360512 X-GMAIL-MSGID: 1774304031035360512 bitmap and khz is assigned first, so it does not need to initialize the assignment. Signed-off-by: Li zeming --- arch/x86/kvm/x86.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 278dbd37dab2..62715bb4754d 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -6529,7 +6529,7 @@ static void kvm_free_msr_filter(struct kvm_x86_msr_filter *msr_filter) static int kvm_add_msr_filter(struct kvm_x86_msr_filter *msr_filter, struct kvm_msr_filter_range *user_range) { - unsigned long *bitmap = NULL; + unsigned long *bitmap; size_t bitmap_size; if (!user_range->nmsrs) @@ -9169,7 +9169,7 @@ static int kvmclock_cpu_down_prep(unsigned int cpu) static void tsc_khz_changed(void *data) { struct cpufreq_freqs *freq = data; - unsigned long khz = 0; + unsigned long khz; WARN_ON_ONCE(boot_cpu_has(X86_FEATURE_CONSTANT_TSC));