error: Use error_fatal to simplify obvious fatal errors (again)
Patch created mechanically by rerunning: $ spatch --in-place --sp-file scripts/coccinelle/use-error_fatal.cocci \ --macro-file scripts/cocci-macro-file.h --use-gitgrep . Variables now unused dropped manually. Cc: Eric Auger <eric.auger@redhat.com> Cc: David Hildenbrand <david@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20200722084048.1726105-5-armbru@redhat.com> Reviewed-by: David Hildenbrand <david@redhat.com>
This commit is contained in:
parent
2155ceaf25
commit
805d44961b
11
exec.c
11
exec.c
|
@ -623,8 +623,7 @@ static void tcg_register_iommu_notifier(CPUState *cpu,
|
||||||
*/
|
*/
|
||||||
MemoryRegion *mr = MEMORY_REGION(iommu_mr);
|
MemoryRegion *mr = MEMORY_REGION(iommu_mr);
|
||||||
TCGIOMMUNotifier *notifier;
|
TCGIOMMUNotifier *notifier;
|
||||||
Error *err = NULL;
|
int i;
|
||||||
int i, ret;
|
|
||||||
|
|
||||||
for (i = 0; i < cpu->iommu_notifiers->len; i++) {
|
for (i = 0; i < cpu->iommu_notifiers->len; i++) {
|
||||||
notifier = g_array_index(cpu->iommu_notifiers, TCGIOMMUNotifier *, i);
|
notifier = g_array_index(cpu->iommu_notifiers, TCGIOMMUNotifier *, i);
|
||||||
|
@ -653,12 +652,8 @@ static void tcg_register_iommu_notifier(CPUState *cpu,
|
||||||
0,
|
0,
|
||||||
HWADDR_MAX,
|
HWADDR_MAX,
|
||||||
iommu_idx);
|
iommu_idx);
|
||||||
ret = memory_region_register_iommu_notifier(notifier->mr, ¬ifier->n,
|
memory_region_register_iommu_notifier(notifier->mr, ¬ifier->n,
|
||||||
&err);
|
&error_fatal);
|
||||||
if (ret) {
|
|
||||||
error_report_err(err);
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!notifier->active) {
|
if (!notifier->active) {
|
||||||
|
|
|
@ -161,7 +161,6 @@ static void virtio_ccw_register_hcalls(void)
|
||||||
static void s390_memory_init(MemoryRegion *ram)
|
static void s390_memory_init(MemoryRegion *ram)
|
||||||
{
|
{
|
||||||
MemoryRegion *sysmem = get_system_memory();
|
MemoryRegion *sysmem = get_system_memory();
|
||||||
Error *local_err = NULL;
|
|
||||||
|
|
||||||
/* allocate RAM for core */
|
/* allocate RAM for core */
|
||||||
memory_region_add_subregion(sysmem, 0, ram);
|
memory_region_add_subregion(sysmem, 0, ram);
|
||||||
|
@ -170,11 +169,7 @@ static void s390_memory_init(MemoryRegion *ram)
|
||||||
* Configure the maximum page size. As no memory devices were created
|
* Configure the maximum page size. As no memory devices were created
|
||||||
* yet, this is the page size of initial memory only.
|
* yet, this is the page size of initial memory only.
|
||||||
*/
|
*/
|
||||||
s390_set_max_pagesize(qemu_maxrampagesize(), &local_err);
|
s390_set_max_pagesize(qemu_maxrampagesize(), &error_fatal);
|
||||||
if (local_err) {
|
|
||||||
error_report_err(local_err);
|
|
||||||
exit(EXIT_FAILURE);
|
|
||||||
}
|
|
||||||
/* Initialize storage key device */
|
/* Initialize storage key device */
|
||||||
s390_skeys_init();
|
s390_skeys_init();
|
||||||
/* Initialize storage attributes device */
|
/* Initialize storage attributes device */
|
||||||
|
|
|
@ -712,9 +712,8 @@ static void vhost_iommu_region_add(MemoryListener *listener,
|
||||||
iommu_listener);
|
iommu_listener);
|
||||||
struct vhost_iommu *iommu;
|
struct vhost_iommu *iommu;
|
||||||
Int128 end;
|
Int128 end;
|
||||||
int iommu_idx, ret;
|
int iommu_idx;
|
||||||
IOMMUMemoryRegion *iommu_mr;
|
IOMMUMemoryRegion *iommu_mr;
|
||||||
Error *err = NULL;
|
|
||||||
|
|
||||||
if (!memory_region_is_iommu(section->mr)) {
|
if (!memory_region_is_iommu(section->mr)) {
|
||||||
return;
|
return;
|
||||||
|
@ -737,11 +736,8 @@ static void vhost_iommu_region_add(MemoryListener *listener,
|
||||||
iommu->iommu_offset = section->offset_within_address_space -
|
iommu->iommu_offset = section->offset_within_address_space -
|
||||||
section->offset_within_region;
|
section->offset_within_region;
|
||||||
iommu->hdev = dev;
|
iommu->hdev = dev;
|
||||||
ret = memory_region_register_iommu_notifier(section->mr, &iommu->n, &err);
|
memory_region_register_iommu_notifier(section->mr, &iommu->n,
|
||||||
if (ret) {
|
&error_fatal);
|
||||||
error_report_err(err);
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
QLIST_INSERT_HEAD(&dev->iommu_list, iommu, iommu_next);
|
QLIST_INSERT_HEAD(&dev->iommu_list, iommu, iommu_next);
|
||||||
/* TODO: can replay help performance here? */
|
/* TODO: can replay help performance here? */
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue