in vhost_vdpa_listener_region_del(), try_unmap is always true and so,
vhost_vdpa_dma_unmap() is always called. We can remove the variable
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Li Qiang <liq3ea@gmail.com>
Message-Id: <
20200920152024.860172-1-lvivier@redhat.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
hwaddr iova;
Int128 llend, llsize;
int ret;
- bool try_unmap = true;
if (vhost_vdpa_listener_skipped_section(section)) {
return;
llsize = int128_sub(llend, int128_make64(iova));
- if (try_unmap) {
- ret = vhost_vdpa_dma_unmap(v, iova, int128_get64(llsize));
- if (ret) {
- error_report("vhost_vdpa dma unmap error!");
- }
+ ret = vhost_vdpa_dma_unmap(v, iova, int128_get64(llsize));
+ if (ret) {
+ error_report("vhost_vdpa dma unmap error!");
}
memory_region_unref(section->mr);