Skip to content

Commit 95be17e

Browse files
jones-drewsean-jc
authored andcommitted
KVM: selftests: aarch64: Remove redundant newlines
TEST_* functions append their own newline. Remove newlines from TEST_* callsites to avoid extra newlines in output. Signed-off-by: Andrew Jones <ajones@ventanamicro.com> Acked-by: Zenghui Yu <yuzenghui@huawei.com> Link: https://lore.kernel.org/r/20231206170241.82801-9-ajones@ventanamicro.com Signed-off-by: Sean Christopherson <seanjc@google.com>
1 parent 250e138 commit 95be17e

File tree

7 files changed

+27
-27
lines changed

7 files changed

+27
-27
lines changed

tools/testing/selftests/kvm/aarch64/arch_timer.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ static void *test_vcpu_run(void *arg)
248248
REPORT_GUEST_ASSERT(uc);
249249
break;
250250
default:
251-
TEST_FAIL("Unexpected guest exit\n");
251+
TEST_FAIL("Unexpected guest exit");
252252
}
253253

254254
return NULL;
@@ -287,7 +287,7 @@ static int test_migrate_vcpu(unsigned int vcpu_idx)
287287

288288
/* Allow the error where the vCPU thread is already finished */
289289
TEST_ASSERT(ret == 0 || ret == ESRCH,
290-
"Failed to migrate the vCPU:%u to pCPU: %u; ret: %d\n",
290+
"Failed to migrate the vCPU:%u to pCPU: %u; ret: %d",
291291
vcpu_idx, new_pcpu, ret);
292292

293293
return ret;
@@ -326,12 +326,12 @@ static void test_run(struct kvm_vm *vm)
326326

327327
pthread_mutex_init(&vcpu_done_map_lock, NULL);
328328
vcpu_done_map = bitmap_zalloc(test_args.nr_vcpus);
329-
TEST_ASSERT(vcpu_done_map, "Failed to allocate vcpu done bitmap\n");
329+
TEST_ASSERT(vcpu_done_map, "Failed to allocate vcpu done bitmap");
330330

331331
for (i = 0; i < (unsigned long)test_args.nr_vcpus; i++) {
332332
ret = pthread_create(&pt_vcpu_run[i], NULL, test_vcpu_run,
333333
(void *)(unsigned long)i);
334-
TEST_ASSERT(!ret, "Failed to create vCPU-%d pthread\n", i);
334+
TEST_ASSERT(!ret, "Failed to create vCPU-%d pthread", i);
335335
}
336336

337337
/* Spawn a thread to control the vCPU migrations */
@@ -340,7 +340,7 @@ static void test_run(struct kvm_vm *vm)
340340

341341
ret = pthread_create(&pt_vcpu_migration, NULL,
342342
test_vcpu_migration, NULL);
343-
TEST_ASSERT(!ret, "Failed to create the migration pthread\n");
343+
TEST_ASSERT(!ret, "Failed to create the migration pthread");
344344
}
345345

346346

@@ -384,7 +384,7 @@ static struct kvm_vm *test_vm_create(void)
384384
if (kvm_has_cap(KVM_CAP_COUNTER_OFFSET))
385385
vm_ioctl(vm, KVM_ARM_SET_COUNTER_OFFSET, &test_args.offset);
386386
else
387-
TEST_FAIL("no support for global offset\n");
387+
TEST_FAIL("no support for global offset");
388388
}
389389

390390
for (i = 0; i < nr_vcpus; i++)

tools/testing/selftests/kvm/aarch64/hypercalls.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -175,18 +175,18 @@ static void test_fw_regs_before_vm_start(struct kvm_vcpu *vcpu)
175175
/* First 'read' should be an upper limit of the features supported */
176176
vcpu_get_reg(vcpu, reg_info->reg, &val);
177177
TEST_ASSERT(val == FW_REG_ULIMIT_VAL(reg_info->max_feat_bit),
178-
"Expected all the features to be set for reg: 0x%lx; expected: 0x%lx; read: 0x%lx\n",
178+
"Expected all the features to be set for reg: 0x%lx; expected: 0x%lx; read: 0x%lx",
179179
reg_info->reg, FW_REG_ULIMIT_VAL(reg_info->max_feat_bit), val);
180180

181181
/* Test a 'write' by disabling all the features of the register map */
182182
ret = __vcpu_set_reg(vcpu, reg_info->reg, 0);
183183
TEST_ASSERT(ret == 0,
184-
"Failed to clear all the features of reg: 0x%lx; ret: %d\n",
184+
"Failed to clear all the features of reg: 0x%lx; ret: %d",
185185
reg_info->reg, errno);
186186

187187
vcpu_get_reg(vcpu, reg_info->reg, &val);
188188
TEST_ASSERT(val == 0,
189-
"Expected all the features to be cleared for reg: 0x%lx\n", reg_info->reg);
189+
"Expected all the features to be cleared for reg: 0x%lx", reg_info->reg);
190190

191191
/*
192192
* Test enabling a feature that's not supported.
@@ -195,7 +195,7 @@ static void test_fw_regs_before_vm_start(struct kvm_vcpu *vcpu)
195195
if (reg_info->max_feat_bit < 63) {
196196
ret = __vcpu_set_reg(vcpu, reg_info->reg, BIT(reg_info->max_feat_bit + 1));
197197
TEST_ASSERT(ret != 0 && errno == EINVAL,
198-
"Unexpected behavior or return value (%d) while setting an unsupported feature for reg: 0x%lx\n",
198+
"Unexpected behavior or return value (%d) while setting an unsupported feature for reg: 0x%lx",
199199
errno, reg_info->reg);
200200
}
201201
}
@@ -216,7 +216,7 @@ static void test_fw_regs_after_vm_start(struct kvm_vcpu *vcpu)
216216
*/
217217
vcpu_get_reg(vcpu, reg_info->reg, &val);
218218
TEST_ASSERT(val == 0,
219-
"Expected all the features to be cleared for reg: 0x%lx\n",
219+
"Expected all the features to be cleared for reg: 0x%lx",
220220
reg_info->reg);
221221

222222
/*
@@ -226,7 +226,7 @@ static void test_fw_regs_after_vm_start(struct kvm_vcpu *vcpu)
226226
*/
227227
ret = __vcpu_set_reg(vcpu, reg_info->reg, FW_REG_ULIMIT_VAL(reg_info->max_feat_bit));
228228
TEST_ASSERT(ret != 0 && errno == EBUSY,
229-
"Unexpected behavior or return value (%d) while setting a feature while VM is running for reg: 0x%lx\n",
229+
"Unexpected behavior or return value (%d) while setting a feature while VM is running for reg: 0x%lx",
230230
errno, reg_info->reg);
231231
}
232232
}
@@ -265,7 +265,7 @@ static void test_guest_stage(struct kvm_vm **vm, struct kvm_vcpu **vcpu)
265265
case TEST_STAGE_HVC_IFACE_FALSE_INFO:
266266
break;
267267
default:
268-
TEST_FAIL("Unknown test stage: %d\n", prev_stage);
268+
TEST_FAIL("Unknown test stage: %d", prev_stage);
269269
}
270270
}
271271

@@ -294,7 +294,7 @@ static void test_run(void)
294294
REPORT_GUEST_ASSERT(uc);
295295
break;
296296
default:
297-
TEST_FAIL("Unexpected guest exit\n");
297+
TEST_FAIL("Unexpected guest exit");
298298
}
299299
}
300300

tools/testing/selftests/kvm/aarch64/page_fault_test.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -414,10 +414,10 @@ static bool punch_hole_in_backing_store(struct kvm_vm *vm,
414414
if (fd != -1) {
415415
ret = fallocate(fd, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE,
416416
0, paging_size);
417-
TEST_ASSERT(ret == 0, "fallocate failed\n");
417+
TEST_ASSERT(ret == 0, "fallocate failed");
418418
} else {
419419
ret = madvise(hva, paging_size, MADV_DONTNEED);
420-
TEST_ASSERT(ret == 0, "madvise failed\n");
420+
TEST_ASSERT(ret == 0, "madvise failed");
421421
}
422422

423423
return true;
@@ -501,7 +501,7 @@ static bool handle_cmd(struct kvm_vm *vm, int cmd)
501501

502502
void fail_vcpu_run_no_handler(int ret)
503503
{
504-
TEST_FAIL("Unexpected vcpu run failure\n");
504+
TEST_FAIL("Unexpected vcpu run failure");
505505
}
506506

507507
void fail_vcpu_run_mmio_no_syndrome_handler(int ret)

tools/testing/selftests/kvm/aarch64/smccc_filter.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ static void expect_call_denied(struct kvm_vcpu *vcpu)
178178
struct ucall uc;
179179

180180
if (get_ucall(vcpu, &uc) != UCALL_SYNC)
181-
TEST_FAIL("Unexpected ucall: %lu\n", uc.cmd);
181+
TEST_FAIL("Unexpected ucall: %lu", uc.cmd);
182182

183183
TEST_ASSERT(uc.args[1] == SMCCC_RET_NOT_SUPPORTED,
184184
"Unexpected SMCCC return code: %lu", uc.args[1]);

tools/testing/selftests/kvm/aarch64/vpmu_counter_access.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -517,11 +517,11 @@ static void test_create_vpmu_vm_with_pmcr_n(uint64_t pmcr_n, bool expect_fail)
517517

518518
if (expect_fail)
519519
TEST_ASSERT(pmcr_orig == pmcr,
520-
"PMCR.N modified by KVM to a larger value (PMCR: 0x%lx) for pmcr_n: 0x%lx\n",
520+
"PMCR.N modified by KVM to a larger value (PMCR: 0x%lx) for pmcr_n: 0x%lx",
521521
pmcr, pmcr_n);
522522
else
523523
TEST_ASSERT(pmcr_n == get_pmcr_n(pmcr),
524-
"Failed to update PMCR.N to %lu (received: %lu)\n",
524+
"Failed to update PMCR.N to %lu (received: %lu)",
525525
pmcr_n, get_pmcr_n(pmcr));
526526
}
527527

@@ -594,12 +594,12 @@ static void run_pmregs_validity_test(uint64_t pmcr_n)
594594
*/
595595
vcpu_get_reg(vcpu, KVM_ARM64_SYS_REG(set_reg_id), &reg_val);
596596
TEST_ASSERT((reg_val & (~valid_counters_mask)) == 0,
597-
"Initial read of set_reg: 0x%llx has unimplemented counters enabled: 0x%lx\n",
597+
"Initial read of set_reg: 0x%llx has unimplemented counters enabled: 0x%lx",
598598
KVM_ARM64_SYS_REG(set_reg_id), reg_val);
599599

600600
vcpu_get_reg(vcpu, KVM_ARM64_SYS_REG(clr_reg_id), &reg_val);
601601
TEST_ASSERT((reg_val & (~valid_counters_mask)) == 0,
602-
"Initial read of clr_reg: 0x%llx has unimplemented counters enabled: 0x%lx\n",
602+
"Initial read of clr_reg: 0x%llx has unimplemented counters enabled: 0x%lx",
603603
KVM_ARM64_SYS_REG(clr_reg_id), reg_val);
604604

605605
/*
@@ -611,12 +611,12 @@ static void run_pmregs_validity_test(uint64_t pmcr_n)
611611

612612
vcpu_get_reg(vcpu, KVM_ARM64_SYS_REG(set_reg_id), &reg_val);
613613
TEST_ASSERT((reg_val & (~valid_counters_mask)) == 0,
614-
"Read of set_reg: 0x%llx has unimplemented counters enabled: 0x%lx\n",
614+
"Read of set_reg: 0x%llx has unimplemented counters enabled: 0x%lx",
615615
KVM_ARM64_SYS_REG(set_reg_id), reg_val);
616616

617617
vcpu_get_reg(vcpu, KVM_ARM64_SYS_REG(clr_reg_id), &reg_val);
618618
TEST_ASSERT((reg_val & (~valid_counters_mask)) == 0,
619-
"Read of clr_reg: 0x%llx has unimplemented counters enabled: 0x%lx\n",
619+
"Read of clr_reg: 0x%llx has unimplemented counters enabled: 0x%lx",
620620
KVM_ARM64_SYS_REG(clr_reg_id), reg_val);
621621
}
622622

tools/testing/selftests/kvm/lib/aarch64/processor.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ void vcpu_args_set(struct kvm_vcpu *vcpu, unsigned int num, ...)
398398
int i;
399399

400400
TEST_ASSERT(num >= 1 && num <= 8, "Unsupported number of args,\n"
401-
" num: %u\n", num);
401+
" num: %u", num);
402402

403403
va_start(ap, num);
404404

tools/testing/selftests/kvm/lib/aarch64/vgic.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ int vgic_v3_setup(struct kvm_vm *vm, unsigned int nr_vcpus, uint32_t nr_irqs,
3838
struct list_head *iter;
3939
unsigned int nr_gic_pages, nr_vcpus_created = 0;
4040

41-
TEST_ASSERT(nr_vcpus, "Number of vCPUs cannot be empty\n");
41+
TEST_ASSERT(nr_vcpus, "Number of vCPUs cannot be empty");
4242

4343
/*
4444
* Make sure that the caller is infact calling this
@@ -47,7 +47,7 @@ int vgic_v3_setup(struct kvm_vm *vm, unsigned int nr_vcpus, uint32_t nr_irqs,
4747
list_for_each(iter, &vm->vcpus)
4848
nr_vcpus_created++;
4949
TEST_ASSERT(nr_vcpus == nr_vcpus_created,
50-
"Number of vCPUs requested (%u) doesn't match with the ones created for the VM (%u)\n",
50+
"Number of vCPUs requested (%u) doesn't match with the ones created for the VM (%u)",
5151
nr_vcpus, nr_vcpus_created);
5252

5353
/* Distributor setup */

0 commit comments

Comments
 (0)