Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp1192621pxb; Fri, 21 Jan 2022 11:56:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJyEH8J/6qszaTLjs+cfJ/FG/gYTHceB4PXvCGLCeGW4fr3c4UhK0M3othFlx6AgqBd/CfBp X-Received: by 2002:a05:6a00:1a52:b0:4c6:a871:b5db with SMTP id h18-20020a056a001a5200b004c6a871b5dbmr4873950pfv.66.1642794986290; Fri, 21 Jan 2022 11:56:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642794986; cv=none; d=google.com; s=arc-20160816; b=RmInVt28R0po+T+r5RQtEgUkJRlxTxa9rfA+wr1dTrbV4chH4nllpAlWX3Ih8mSeFX SmQUpcZ3k9peE0pbERhvnIAkltL6dneUGKQG3y8i1uHVnm/2e5ggJVjYntJgYZlCAybU 4IYFeHA+BhRj1Ulpoa7HGJusM5sVm+/amsp612KVXcNdd98ZBqtg6GWwOa9v47A2wRuh FODqjI9b9lhU3FrDwPEwz1/WY+cWLeghJH7SQ8u/DBdHyCiakRn45Za4z4A+NByKBjkh t6juH3xUBzjIBOEce32UcWPyppcKwl3IYJzdxu6K6muZMzEaYhV9rKTJoUBAc+KHiDOI KW7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=rorpKq4thwCv1KEG1dELrIisL1eH74YJusfX4RC+vh4=; b=HaGRb+U8W18/Et7lUPsw/D8GgSumoowG4Qwc4Zw/ZMgG6q+0MfBpPdbSRsy7+qaD51 WZPuEijvUx8Hky/+bFFZNgRrdaGwQNjYakhVHt5sWcZOvhbv4WC+AIHtFFAGmauS4jTi onxFxdPr+rVstN+NtkOQdp67BoQGiRSoz85VJSwah4MmOCmcvmIFNe5r4INCvtCg/Pxp DkHpUzJNH3SN6Qcwauoz/bEbLjFoSuDwnhryMCafGTdaic/6UWdr8P7U/PjDef4863n6 /crtaMiFNYFVoaKng5d4JuCicPUE4cKCCX+IWPceJ+DorqjniohYLgBFSijX68lFG9YT eebg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=azI1ISY5; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h9si7359254pgg.455.2022.01.21.11.56.14; Fri, 21 Jan 2022 11:56:26 -0800 (PST) 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=@redhat.com header.s=mimecast20190719 header.b=azI1ISY5; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1356791AbiASShd (ORCPT + 99 others); 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-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