Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp1166503pxb; Fri, 21 Jan 2022 11:15:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJwNczFdtqRugPmWC0RMCyYllqjLbKX6QxRz/Z2rurN4kxJaRVbYFmuJgFLGInoZsS0ewA65 X-Received: by 2002:a63:9142:: with SMTP id l63mr3937198pge.476.1642792550921; Fri, 21 Jan 2022 11:15:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642792550; cv=none; d=google.com; s=arc-20160816; b=EeVXCMwPEtuWpF03b9MIumCAdCZSl0zdtXy28VwI0PiYC8tCI1e2R/Z+F9SPa2cd3w hSjT+WGNxTrbejjXhVsQwLPPTtP6cqjEG2O2l3mgP1lcuhmXiHtO5Vy8gft98NoXzPtF zk2QMY5Gp0BHdKWXQjsCA3N1xInpf+nnKRFLo2CL+hYmnwJo3xirGT2QVAxjMMafjfHr o7AsTcHXWEpcQcf0dY4u8pS3Y+OMc4U9Htw0N0AwdzDOdz1YzJiYcGA6RjI2omc7jQc9 s5FA1j2w3UO/rz7mJMj+6L90nMuSzwrwRnnweqLmYLivm4e/0sfhHRsBViDGfd1AHNsc ZMeQ== 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=8NOXdq1kEY3pOnmXg+Zn+1SGl/zikNGQrQDpkrXSeQA=; b=EJ28jK20VDUZmP2dQGqPsfEwT2ASdgVk4CkR1XqbkWFgi+ehUoua1r7NZUKGI9VlxC jmlDmcWrUcum4Gr/caWUL6qqnh7wJBgp30U7jkZVrzgKVHGpu2/hmn+xXNDmEfqDwfHM kjS6zvsPxxPKdvmbQt7NZBH67vGtEHuwcBLGJt8SkSh0tASkJZCvk9gz5d5p0z+592/f AKhkQT5hsKgJU1uRsC3U4KbAdkpmDxIGxBdsJ6IMr710crajRa/O+FWW38zZ3i/N439Y 97ni28G4uFcn0rGgljlpiUpfe3Rdq5n3iwv04UnpeGld8/+6LiLlPx6R+m7PX0NUL2vl I2NA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Grw0I8Bz; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m194si1291630pga.618.2022.01.21.11.15.38; Fri, 21 Jan 2022 11:15:50 -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=@gmail.com header.s=20210112 header.b=Grw0I8Bz; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349815AbiASNjX (ORCPT + 99 others); Wed, 19 Jan 2022 08:39:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33394 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343938AbiASNjV (ORCPT ); Wed, 19 Jan 2022 08:39:21 -0500 Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 001B4C061574; Wed, 19 Jan 2022 05:39:20 -0800 (PST) Received: by mail-pf1-x444.google.com with SMTP id w204so2363580pfc.7; Wed, 19 Jan 2022 05:39:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=8NOXdq1kEY3pOnmXg+Zn+1SGl/zikNGQrQDpkrXSeQA=; b=Grw0I8Bzf3z0IHW0BPyppfRlgsOpAmqrKFVYYTprerDwmzSoS+tmFuXTp2661nCk2s 0sdPZfeHJLIhB+PkiPaVNCvF1QRQxTNAsQ7Zig7jaMPJLOj5M1j7J9VPEw0+E60+5rZP ME64QZRADsy/M4/FKXSx7nBw1Lk9omFXkAn+iN4ABo78VjzUV4N9ND4MSF2kk9Mbtl+v JieQ7jRnuSftsO4NNb2VYpYwSSXuyuILLMcLuEQjRZDrHO9Ji4wrwjHDqeYa4PRXtpyr iJ86LZfzPyHPerpqy1dhKTkrhxmSZhSUrj4ktbsU1P0WrcfHvSa08of8QOklJ1AoBZ8K J5RA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=8NOXdq1kEY3pOnmXg+Zn+1SGl/zikNGQrQDpkrXSeQA=; b=Zap0HZ+DbR2LsgXjwnc5zb7RDj3wipv6A/22IjYc7oTKi+Hs7BynHesWND2gUgkv3T Uh7Yeda79LlPQDxmU3lugRNtJPWKiSvtmOFvuYcaRtIclZ5VyUSBqxIKQmWg+mxq7Bmv mOqsBLLZWJx79/mXzXHqusttcRei5El0+pZ18jrzljTetFOP682t9t3xFIwL/LPsF74R i8Vr6T6FwDGVegYahWYdjJcW/1YgIMs0u3e9UbrWjgflpLhGqt+c3ORxB1cvwjMfbRWn Ro646x6dpf/4zvmVTjJIvumuPW97kxzKi/zdS6sYcRN0T9GsVNJbeLEt4t2uJZD5Hoyt CvkA== X-Gm-Message-State: AOAM533NjWotDYqWX0rmAMxsg6wg1Iku0iWvRLL2XUnVr3h9vFZFuea2 HFUVKlV2vjzEf+jSEE/4PLkVCn/lfrmS9Q== X-Received: by 2002:a62:1996:0:b0:4bb:db58:9f6d with SMTP id 144-20020a621996000000b004bbdb589f6dmr30887470pfz.31.1642599560575; Wed, 19 Jan 2022 05:39:20 -0800 (PST) Received: from CLOUDLIANG-MB0.tencent.com ([103.7.29.32]) by smtp.gmail.com with ESMTPSA id k8sm6308709pjj.3.2022.01.19.05.39.17 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 19 Jan 2022 05:39:20 -0800 (PST) From: Jinrong Liang X-Google-Original-From: Jinrong Liang To: Paolo Bonzini Cc: Wanpeng Li , Sean Christopherson , Jim Mattson , Vitaly Kuznetsov , Joerg Roedel , Jinrong Liang , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] selftests: kvm/x86: Fix the warning in pmu_event_filter_test.c Date: Wed, 19 Jan 2022 21:39:10 +0800 Message-Id: <20220119133910.56285-1-cloudliang@tencent.com> X-Mailer: git-send-email 2.30.1 (Apple Git-130) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 && -- 2.33.1