From: shijie001@208suo.com
To: pbonzini@redhat.com
Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] KVM: Fix warnings in irqchip.c
Date: Mon, 17 Jul 2023 11:27:01 +0800 [thread overview]
Message-ID: <2ec15b819263c1b9e0ee08da6b605006@208suo.com> (raw)
In-Reply-To: <tencent_E7FFD5AD20D6F7A59A915FD8CB1385FC8806@qq.com>
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@208suo.com>
---
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;
parent reply other threads:[~2023-07-17 3:27 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <tencent_E7FFD5AD20D6F7A59A915FD8CB1385FC8806@qq.com>]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2ec15b819263c1b9e0ee08da6b605006@208suo.com \
--to=shijie001@208suo.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®