[PATCH] KVM: Fix warnings in irqchip.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The following checkpatch warnings are removed:
WARNING: Prefer 'unsigned int' to bare use of 'unsigned'
WARNING: Missing a blank line after declarations
WARNING: Block comments use * on subsequent lines
WARNING: Block comments use a trailing */ on a separate line
WARNING: Prefer __weak over __attribute__((weak))

Signed-off-by: Jie Shi <shijie001@xxxxxxxxxx>
---
 virt/kvm/irqchip.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/virt/kvm/irqchip.c b/virt/kvm/irqchip.c
index 1e567d1f6d3d..33721848315f 100644
--- a/virt/kvm/irqchip.c
+++ b/virt/kvm/irqchip.c
@@ -37,7 +37,7 @@ int kvm_irq_map_gsi(struct kvm *kvm,
     return n;
 }

-int kvm_irq_map_chip_pin(struct kvm *kvm, unsigned irqchip, unsigned pin) +int kvm_irq_map_chip_pin(struct kvm *kvm, unsigned int irqchip, unsigned int pin)
 {
     struct kvm_irq_routing_table *irq_rt;

@@ -85,6 +85,7 @@ int kvm_set_irq(struct kvm *kvm, int irq_source_id, u32 irq, int level,

     while (i--) {
         int r;
+
         r = irq_set[i].set(&irq_set[i], kvm, irq_source_id, level,
                    line_status);
         if (r < 0)
@@ -118,9 +119,11 @@ static void free_irq_routing_table(struct kvm_irq_routing_table *rt)

 void kvm_free_irq_routing(struct kvm *kvm)
 {
-    /* Called only during vm destruction. Nobody can use the pointer
-       at this stage */
+    /* Called only during vm destruction.
+     * Nobody can use the pointer at this stage.
+     */
struct kvm_irq_routing_table *rt = rcu_access_pointer(kvm->irq_routing);
+
     free_irq_routing_table(rt);
 }

@@ -156,7 +159,7 @@ static int setup_routing_entry(struct kvm *kvm,
     return 0;
 }

-void __attribute__((weak)) kvm_arch_irq_routing_update(struct kvm *kvm)
+void __weak kvm_arch_irq_routing_update(struct kvm *kvm)
 {
 }

@@ -167,8 +170,8 @@ bool __weak kvm_arch_can_set_irq_routing(struct kvm *kvm)

 int kvm_set_irq_routing(struct kvm *kvm,
             const struct kvm_irq_routing_entry *ue,
-            unsigned nr,
-            unsigned flags)
+            unsigned int nr,
+            unsigned int flags)
 {
     struct kvm_irq_routing_table *new, *old;
     struct kvm_kernel_irq_routing_entry *e;



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux