Skip to contentSkip to conversation

virt: kvm: coding style cleanups

PATCH In review Javier Martinez Canillas 2 participants 3 messages Nov 25, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 virt: kvm: coding style cleanups

Fixes coding style issues on virt/kvm/assigned-dev.c

---
 virt/kvm/assigned-dev.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
virt/kvm/assigned-dev.c +2 -1
index ae72ae6..c9dd690 100644
@@ -620,7 +620,7 @@ static int kvm_vm_ioctl_set_msix_nr(struct kvm *kvm,
 			goto msix_nr_out;
 		}
 		adev->guest_msix_entries -			kzalloc(sizeof(struct msix_entry) * entry_nr->entry_nr,
+			kzalloc(sizeof(struct msix_entry) *entry_nr->entry_nr,
 				GFP_KERNEL);
 		if (!adev->guest_msix_entries) {
 			kfree(adev->host_msix_entries);
@@ -750,7 +750,7 @@ long kvm_vm_ioctl_assigned_device(struct kvm *kvm, unsigned ioctl,
 			goto out_free_irq_routing;
 		r = kvm_set_irq_routing(kvm, entries, routing.nr,
 					routing.flags);
-	out_free_irq_routing:
+out_free_irq_routing:
 		vfree(entries);
 		break;
 	}
Signature · 1 line
1.7.0.4
#1 lore raw

Review

Quoted 2 lines · Javier Martinez Canillas
(quoted diff) +1 -0
 		adev->guest_msix_entries > -			kzalloc(sizeof(struct msix_entry) * entry_nr->entry_nr,
+			kzalloc(sizeof(struct msix_entry) *entry_nr->entry_nr,

The original code was right and the new code is wrong.

virt/kvm/assigned-dev.c long kvm_vm_ioctl_assigned_device(struct kvm *kvm, unsigned ioctl, · line 753

Quoted 9 lines
virt/kvm/assigned-dev.c +1 -1
 				GFP_KERNEL);
 		if (!adev->guest_msix_entries) {
 			kfree(adev->host_msix_entries);
@@ -750,7 +750,7 @@ long kvm_vm_ioctl_assigned_device(struct kvm *kvm, unsigned ioctl,
 			goto out_free_irq_routing;
 		r = kvm_set_irq_routing(kvm, entries, routing.nr,
 					routing.flags);
-	out_free_irq_routing:
+out_free_irq_routing:

This is a pointless change.

virt/kvm/assigned-dev.c long kvm_vm_ioctl_assigned_device(struct kvm *kvm, unsigned ioctl, · line 755

Quoted 2 lines
virt/kvm/assigned-dev.c +0 -0
 		vfree(entries);
 		break;

You're wasting people's time here and we like newbies but it makes everyone annoyed.

regards,
dan carpenter

#2 lore raw
In reply to Javier Martinez Canillas
Quoted 4 lines
Quoted 1 line

+                     kzalloc(sizeof(struct msix_entry) *entry_nr->entry_nr,

The original code was right and the new code is wrong.

Sorry for not looking at the code closely.

Quoted 7 lines

You're wasting people's time here and we like newbies but it makes everyone annoyed.

regards,
dan carpenter

The Linux kernel learning curve is getting bigger and bigger, the only way we (newbies) can enter the development process is trough trivial patches. So yes we are annoying although necessary.

Sorry for the noise it won't happen again.

Thanks a lot.

Signature · 5 lines
Best regards,

-----------------------------------------
Javier Martínez Canillas
(+34) 682 39 81 69