mbox series

[v3,0/3] target/loongarch: Solve some issues reported from coccinelle

Message ID 20250317022922.802988-1-maobibo@loongson.cn (mailing list archive)
Headers show
Series target/loongarch: Solve some issues reported from coccinelle | expand

Message

Bibo Mao March 17, 2025, 2:29 a.m. UTC
This patch set solves errors reported by coccinelle tool with commands:
  spatch --sp-file scripts/coccinelle/*.cocci --dir target/loongarch/
  spatch --sp-file scripts/coccinelle/*.cocci --dir hw/loongarch/

The main problem is that qemu should fail to run when feature is forced
to enabled however KVM does not support it, rather than report error and
continue to run.

---
  v2 ... v3:
    1. Add missing modification replacing error_propagate() + error_setg()
      with error_setg().
    2. Some enhancement about error handling, handling error
       symmetrically in many places

  v1 ... v2:
    1. Add fixes tag and change title with fix prefix in patch 1.
    2. Replace error_propagate() with error_setg(), and return directly
       for any error.
---
Bibo Mao (3):
  target/loongarch: Fix error handling of KVM feature checks
  hw/loongarch/virt: Remove unnecessary NULL pointer
  target/loongarch: Remove unnecessary temporary variable assignment

 hw/loongarch/virt.c               | 28 +++++++++++-----------------
 target/loongarch/kvm/kvm.c        |  8 ++++++--
 target/loongarch/tcg/tlb_helper.c |  5 ++---
 3 files changed, 19 insertions(+), 22 deletions(-)


base-commit: aa90f1161bb17a4863e16ec2f75104cff0752d4e