Message ID | 20200827110311.164316-1-kuhn.chenqun@huawei.com |
---|---|
Headers | show |
Series | trivial patchs for static code analyzer fixes | expand |
Le 27/08/2020 à 13:03, Chen Qun a écrit : > Clang static code analyzer show warning: > hw/arm/virt-acpi-build.c:641:5: warning: Value stored to 'madt' is never read > madt = acpi_data_push(table_data, sizeof *madt); > ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > Reported-by: Euler Robot <euler.robot@huawei.com> > Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com> > Reviewed-by: Igor Mammedov <imammedo@redhat.com> > Reviewed-by: Li Qiang <liq3ea@gmail.com> > --- > Cc: Shannon Zhao <shannon.zhaosl@gmail.com> > Cc: Peter Maydell <peter.maydell@linaro.org> > Cc: "Michael S. Tsirkin" <mst@redhat.com> > Cc: Igor Mammedov <imammedo@redhat.com> > Cc: qemu-arm@nongnu.org > --- > hw/arm/virt-acpi-build.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c > index 91f0df7b13..f830f9b779 100644 > --- a/hw/arm/virt-acpi-build.c > +++ b/hw/arm/virt-acpi-build.c > @@ -633,12 +633,11 @@ build_madt(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms) > int madt_start = table_data->len; > const MemMapEntry *memmap = vms->memmap; > const int *irqmap = vms->irqmap; > - AcpiMultipleApicTable *madt; > AcpiMadtGenericDistributor *gicd; > AcpiMadtGenericMsiFrame *gic_msi; > int i; > > - madt = acpi_data_push(table_data, sizeof *madt); > + acpi_data_push(table_data, sizeof(AcpiMultipleApicTable)); > > gicd = acpi_data_push(table_data, sizeof *gicd); > gicd->type = ACPI_APIC_GENERIC_DISTRIBUTOR; > Applied to my trivial-patches branch. Thanks, Laurent
Le 27/08/2020 à 13:03, Chen Qun a écrit : > Clang static code analyzer show warning: > target/arm/translate-a64.c:8635:14: warning: Value stored to 'tcg_rn' during its > initialization is never read > TCGv_i64 tcg_rn = new_tmp_a64(s); > ^~~~~~ ~~~~~~~~~~~~~~ > target/arm/translate-a64.c:8636:14: warning: Value stored to 'tcg_rd' during its > initialization is never read > TCGv_i64 tcg_rd = new_tmp_a64(s); > ^~~~~~ ~~~~~~~~~~~~~~ > > Reported-by: Euler Robot <euler.robot@huawei.com> > Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com> > Reviewed-by: Peter Maydell <peter.maydell@linaro.org> > --- > Cc: Peter Maydell <peter.maydell@linaro.org> > Cc: qemu-arm@nongnu.org > > v2->v3:According to Peter's review, the variable 's' does not have a memleak, > so deleted the description about memleak. > --- > target/arm/translate-a64.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c > index 534c3ff5f3..c83bb85e4e 100644 > --- a/target/arm/translate-a64.c > +++ b/target/arm/translate-a64.c > @@ -8632,8 +8632,8 @@ static void handle_scalar_simd_shli(DisasContext *s, bool insert, > int size = 32 - clz32(immh) - 1; > int immhb = immh << 3 | immb; > int shift = immhb - (8 << size); > - TCGv_i64 tcg_rn = new_tmp_a64(s); > - TCGv_i64 tcg_rd = new_tmp_a64(s); > + TCGv_i64 tcg_rn; > + TCGv_i64 tcg_rd; > > if (!extract32(immh, 3, 1)) { > unallocated_encoding(s); > Applied to my trivial-patches branch. Thanks, Laurent
Le 27/08/2020 à 13:03, Chen Qun a écrit : > Clang static code analyzer show warning: > qemu/hw/usb/bus.c:615:13: warning: Value stored to 'pos' is never read > pos += snprintf(fw_path + pos, fw_len - pos, "%s@%lx", > > Reported-by: Euler Robot <euler.robot@huawei.com> > Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com> > Reviewed-by: Markus Armbruster <armbru@redhat.com> > --- > Cc: Gerd Hoffmann <kraxel@redhat.com> > Cc: Markus Armbruster <armbru@redhat.com> > > v2->v3: The format of the snprintf statement is modified(Base on Markus review). > --- > hw/usb/bus.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/hw/usb/bus.c b/hw/usb/bus.c > index b17bda3b29..2b11041451 100644 > --- a/hw/usb/bus.c > +++ b/hw/usb/bus.c > @@ -612,8 +612,8 @@ static char *usb_get_fw_dev_path(DeviceState *qdev) > in++; > } else { > /* the device itself */ > - pos += snprintf(fw_path + pos, fw_len - pos, "%s@%lx", > - qdev_fw_name(qdev), nr); > + snprintf(fw_path + pos, fw_len - pos, "%s@%lx", > + qdev_fw_name(qdev), nr); > break; > } > } > Applied to my trivial-patches branch. Thanks, Laurent