[PATCH linux-next] KVM:define vcpu_get_pid_fops with DEFINE_DEBUGFS_ATTRIBUTE

From: cgel . zte
Date: Sun Aug 14 2022 - 23:12:41 EST


From: ye xingchen <ye.xingchen@xxxxxxxxxx>

>From the coccinelle check:
./virt/kvm/kvm_main.c line 3847
WARNING vcpu_get_pid_fops should be defined with DEFINE_DEBUGFS_ATTRIBUTE

Reported-by: Zeal Robot <zealci@xxxxxxxxxx>
Signed-off-by: ye xingchen <ye.xingchen@xxxxxxxxxx>
---
virt/kvm/kvm_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 515dfe9d3bcf..a0817179f8e4 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -3844,7 +3844,7 @@ static int vcpu_get_pid(void *data, u64 *val)
return 0;
}

-DEFINE_SIMPLE_ATTRIBUTE(vcpu_get_pid_fops, vcpu_get_pid, NULL, "%llu\n");
+DEFINE_DEBUGFS_ATTRIBUTE(vcpu_get_pid_fops, vcpu_get_pid, NULL, "%llu\n");

static void kvm_create_vcpu_debugfs(struct kvm_vcpu *vcpu)
{
--
2.25.1