Skip to contentSkip to conversation

hw/mem/pc-dimm: Trivial code changes

PATCH Applied Wainer dos Santos Moschetta 3 participants 5 messages Mar 10, 2020 – May 4, 2020

lore
Share & tools
lore
#0 lore raw

cover hw/mem/pc-dimm: Trivial code changes

Improve one error message and fix one code style warning.

Wainer dos Santos Moschetta (2):
hw/mem/pc-dimm: Print slot number on error at pc_dimm_pre_plug() hw/mem/pc-dimm: Fix line over 80 characters warning

 hw/mem/pc-dimm.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
Signature · 1 line
2.24.1
#1 lore raw

PATCH 1/2 hw/mem/pc-dimm: Print slot number on error at pc_dimm_pre_plug()

The error report in pc_dimm_pre_plug() now has the slot number printed.

---
 hw/mem/pc-dimm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
hw/mem/pc-dimm.c +2 -2
index 8f50b8afea..36edfcf467 100644
@@ -44,8 +44,8 @@ void pc_dimm_pre_plug(PCDIMMDevice *dimm, MachineState *machine,
                                    &error_abort);
     if ((slot < 0 || slot >= machine->ram_slots) &&
          slot != PC_DIMM_UNASSIGNED_SLOT) {
-        error_setg(&local_err, "invalid slot number, valid range is [0-%"
-                   PRIu64 "]", machine->ram_slots - 1);
+        error_setg(&local_err, "invalid slot number %d, valid range is [0-%"
+                   PRIu64 "]", slot, machine->ram_slots - 1);
         goto out;
     }
 
Signature · 1 line
2.24.1
#2 lore raw

PATCH 2/2 hw/mem/pc-dimm: Fix line over 80 characters warning

In reply to Wainer dos Santos Moschetta
---
 hw/mem/pc-dimm.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
hw/mem/pc-dimm.c +2 -1
index 36edfcf467..6d62588fea 100644
@@ -218,7 +218,8 @@ static MemoryRegion *pc_dimm_get_memory_region(PCDIMMDevice *dimm, Error **errp)
 
 static uint64_t pc_dimm_md_get_addr(const MemoryDeviceState *md)
 {
-    return object_property_get_uint(OBJECT(md), PC_DIMM_ADDR_PROP, &error_abort);
+    return object_property_get_uint(OBJECT(md), PC_DIMM_ADDR_PROP,
+                                    &error_abort);
 }
 
 static void pc_dimm_md_set_addr(MemoryDeviceState *md, uint64_t addr,
Signature · 1 line
2.24.1
Reviewed-by on the v1 series
#3 lore raw
In reply to Wainer dos Santos Moschetta
Quoted 9 lines · Wainer dos Santos Moschetta

Improve one error message and fix one code style warning.

Wainer dos Santos Moschetta (2):
hw/mem/pc-dimm: Print slot number on error at pc_dimm_pre_plug() hw/mem/pc-dimm: Fix line over 80 characters warning

 hw/mem/pc-dimm.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
#4 lore raw
In reply to Wainer dos Santos Moschetta

Le 10/03/2020 à 19:05, Wainer dos Santos Moschetta a écrit :

Quoted 9 lines

Improve one error message and fix one code style warning.

Wainer dos Santos Moschetta (2):
hw/mem/pc-dimm: Print slot number on error at pc_dimm_pre_plug() hw/mem/pc-dimm: Fix line over 80 characters warning

 hw/mem/pc-dimm.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Applied to my trivial-patches branch.

Thanks,
Laurent