From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7C079C433EF for ; Wed, 19 Jan 2022 18:37:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1356820AbiASShd (ORCPT ); Wed, 19 Jan 2022 13:37:33 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:45809 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355446AbiASShc (ORCPT ); Wed, 19 Jan 2022 13:37:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1642617451; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rorpKq4thwCv1KEG1dELrIisL1eH74YJusfX4RC+vh4=; b=azI1ISY57b4AsjAmL6ue/VoZ4b4FnuFqUjsKTHo7D5qHKvX7iFyBFhPQMEzPxuXDBJ0psu x/jMbm/00EHIefDnugZg5eRefR9KTPgupDHmRbO2pZdv+eLqtZI1KYvYqMjiquUingHhtb rTwUXTjaAJS2RpI6Nzf4eV6UmZRmvus= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-359-2KBUa5ZdNuGk8k1auccOkA-1; Wed, 19 Jan 2022 13:37:30 -0500 X-MC-Unique: 2KBUa5ZdNuGk8k1auccOkA-1 Received: by mail-wm1-f71.google.com with SMTP id f187-20020a1c38c4000000b0034d5c66d8f5so2448155wma.5 for ; Wed, 19 Jan 2022 10:37:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=rorpKq4thwCv1KEG1dELrIisL1eH74YJusfX4RC+vh4=; b=mjsqRM/1VsAq44JRiZQUcKiMY8Sd9yiaVTXfe8IEHArF+BjoVMaSmPMmCYrDibLZPK rQbygyWYFTs3jADJkYCMq0tToIjiU+FYhDlCpi85oloZrDFOI9Lsw1ikhcbGApVojEhc syFpkKei2GPF5LJMvgzq/Hp2PlwrohAbztQ3oDa/IyGTGGqURCY45hg8VYNo4+IbICHA fWWTpZEPv41G9ImLRujWAZpc1TOBw9jioz4aBlpg/FL15mEGByarprN5DmWcDDrS30M1 lwqIFKQiNEcT+IeRs65ib/Zmm4GM7Yh1i7PYUlFvpEXLPBDNE3ptl/eOOmt2ZJd4Ncf1 Z5zA== X-Gm-Message-State: AOAM533LBkFN/d6TZU1cPDS7IWWzM59+g7KegGUndsTkAk6pwOQxKzF7 iF7v8PHt+C95bJ6xhVBfwrAKGFGiu7OJgsOeJ2z9i2CIvQIHnFmGa7rbIek+GVb7TQkju3FseKK hgjKpyY4g8bzweGIggswveN3c X-Received: by 2002:a7b:c5c4:: with SMTP id n4mr4881008wmk.134.1642617449192; Wed, 19 Jan 2022 10:37:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJyuPjrpRwwRlHfIoCBn2mOel4lTHQHrc3MO/7ZP8UPstbYjQOqGevgMBrzyQV+VDTreeNVJ+A== X-Received: by 2002:a7b:c5c4:: with SMTP id n4mr4880983wmk.134.1642617448949; Wed, 19 Jan 2022 10:37:28 -0800 (PST) Received: from ?IPV6:2001:b07:6468:f312:c8dd:75d4:99ab:290a? ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.googlemail.com with ESMTPSA id 9sm793256wrb.77.2022.01.19.10.37.27 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 19 Jan 2022 10:37:28 -0800 (PST) Message-ID: <06e16701-1380-8186-2f21-e5cc5a5c8467@redhat.com> Date: Wed, 19 Jan 2022 19:37:26 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.4.0 Subject: Re: [PATCH] selftests: kvm/x86: Fix the warning in pmu_event_filter_test.c Content-Language: en-US To: Jinrong Liang Cc: Wanpeng Li , Sean Christopherson , Jim Mattson , Vitaly Kuznetsov , Joerg Roedel , Jinrong Liang , kvm@vger.kernel.org, linux-kernel@vger.kernel.org References: <20220119133910.56285-1-cloudliang@tencent.com> From: Paolo Bonzini In-Reply-To: <20220119133910.56285-1-cloudliang@tencent.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/19/22 14:39, Jinrong Liang wrote: > From: Jinrong Liang > > The following warning appears when executing > make -C tools/testing/selftests/kvm > > x86_64/pmu_event_filter_test.c: In function ‘vcpu_supports_intel_br_retired’: > x86_64/pmu_event_filter_test.c:241:28: warning: variable ‘cpuid’ set but not used [-Wunused-but-set-variable] > 241 | struct kvm_cpuid2 *cpuid; > | ^~~~~ > x86_64/pmu_event_filter_test.c: In function ‘vcpu_supports_amd_zen_br_retired’: > x86_64/pmu_event_filter_test.c:258:28: warning: variable ‘cpuid’ set but not used [-Wunused-but-set-variable] > 258 | struct kvm_cpuid2 *cpuid; > | ^~~~~ > > Just delete the unused variables to stay away from warnings. > > Fixes: dc7e75b3b3ee ("selftests: kvm/x86: Add test for KVM_SET_PMU_EVENT_FILTER") > Signed-off-by: Jinrong Liang > --- > tools/testing/selftests/kvm/x86_64/pmu_event_filter_test.c | 4 ---- > 1 file changed, 4 deletions(-) > > diff --git a/tools/testing/selftests/kvm/x86_64/pmu_event_filter_test.c b/tools/testing/selftests/kvm/x86_64/pmu_event_filter_test.c > index 8ac99d4cbc73..0611a5c24bbc 100644 > --- a/tools/testing/selftests/kvm/x86_64/pmu_event_filter_test.c > +++ b/tools/testing/selftests/kvm/x86_64/pmu_event_filter_test.c > @@ -238,9 +238,7 @@ static void test_not_member_allow_list(struct kvm_vm *vm) > static bool vcpu_supports_intel_br_retired(void) > { > struct kvm_cpuid_entry2 *entry; > - struct kvm_cpuid2 *cpuid; > > - cpuid = kvm_get_supported_cpuid(); > entry = kvm_get_supported_cpuid_index(0xa, 0); > return entry && > (entry->eax & 0xff) && > @@ -255,9 +253,7 @@ static bool vcpu_supports_intel_br_retired(void) > static bool vcpu_supports_amd_zen_br_retired(void) > { > struct kvm_cpuid_entry2 *entry; > - struct kvm_cpuid2 *cpuid; > > - cpuid = kvm_get_supported_cpuid(); > entry = kvm_get_supported_cpuid_index(1, 0); > return entry && > ((x86_family(entry->eax) == 0x17 && Queued, thanks. Paolo