Skip to contentSkip to conversation

KVM: replace DEFINE_SIMPLE_ATTRIBUTE with DEFINE_DEBUGFS_ATTRIBUTE

PATCH NAK [email protected] 3 participants 4 messages Nov 15, 2022 KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 KVM: replace DEFINE_SIMPLE_ATTRIBUTE with DEFINE_DEBUGFS_ATTRIBUTE

From: guo ziliang <[email protected]>
Fix the following coccicheck warning:
/virt/kvm/kvm_main.c: 3849: 0-23: WARNING: vcpu_get_pid_fops should be defined with DEFINE_DEBUGFS_ATTRIBUTE

---
virt/kvm/kvm_main.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
virt/kvm/kvm_main.c +0 -0
index 2719e10..6e58aec 100644
@@ -3846,7 +3846,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) {
--
1.8.3.1

reviewer NAK
#1 lore raw
Quoted 15 lines · On Tue, Nov 15, 2022, [email protected] wrote:

From: guo ziliang <[email protected]>
Fix the following coccicheck warning:
/virt/kvm/kvm_main.c: 3849: 0-23: WARNING: vcpu_get_pid_fops should be defined with DEFINE_DEBUGFS_ATTRIBUTE

---
virt/kvm/kvm_main.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
virt/kvm/kvm_main.c +0 -0
index 2719e10..6e58aec 100644

virt/kvm/kvm_main.c static int vcpu_get_pid(void *data, u64 *val) · line 3849

Quoted 5 lines
virt/kvm/kvm_main.c +1 -1
@@ -3846,7 +3846,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");

NAK, third time is not a charm.

https://lore.kernel.org/all/[email protected]
https://lore.kernel.org/all/[email protected]

maintainer
#2 lore raw
Quoted 19 lines · Sean Christopherson
Quoted 18 lines · On Tue, Nov 15, 2022, [email protected] wrote:

From: guo ziliang <[email protected]>
Fix the following coccicheck warning:
/virt/kvm/kvm_main.c: 3849: 0-23: WARNING: vcpu_get_pid_fops should be defined with DEFINE_DEBUGFS_ATTRIBUTE

---
virt/kvm/kvm_main.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
virt/kvm/kvm_main.c +0 -0
index 2719e10..6e58aec 100644
@@ -3846,7 +3846,7 @@ static int vcpu_get_pid(void *data, u64 *val)
 return 0;
 }
 
Quoted 7 lines

virt/kvm/kvm_main.c static int vcpu_get_pid(void *data, u64 *val) · line 3849

Quoted 2 lines
virt/kvm/kvm_main.c +1 -1
-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");

NAK, third time is not a charm.

https://lore.kernel.org/all/[email protected]
https://lore.kernel.org/all/[email protected]

Screw it, I'm going to send a pull request just to delete that file.

Paolo

#3 lore raw
Quoted 25 lines · Paolo Bonzini
Quoted 24 lines · Sean Christopherson
Quoted 15 lines · On Tue, Nov 15, 2022, [email protected] wrote:

From: guo ziliang <[email protected]>
Fix the following coccicheck warning:
/virt/kvm/kvm_main.c: 3849: 0-23: WARNING: vcpu_get_pid_fops should be defined with DEFINE_DEBUGFS_ATTRIBUTE

---
virt/kvm/kvm_main.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
virt/kvm/kvm_main.c +0 -0
index 2719e10..6e58aec 100644

virt/kvm/kvm_main.c static int vcpu_get_pid(void *data, u64 *val) · line 3849

Quoted 5 lines
virt/kvm/kvm_main.c +1 -1
@@ -3846,7 +3846,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");

NAK, third time is not a charm.

Quoted 4 lines
Quoted 2 lines

https://lore.kernel.org/all/[email protected]
https://lore.kernel.org/all/[email protected]

Screw it, I'm going to send a pull request just to delete that file.

Heh, I was seriously considering sending a patch to do that too.