[kvm-unit-tests PATCH] Declare the prefix string variable in va_report() as const

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This way, the code can be compiled with "-Wwrite-strings", too.

Signed-off-by: Thomas Huth <thuth@xxxxxxxxxx>
---
 Not sure whether we want to enable "-Wwrite-strings" globally (since
 strings in kvm-unit-test are theoretically writable if the test is
 running without MMU), so I only fixed the code here, without adding
 it to the Makefile. But if we agree that it is a good idea I can
 respin the patch and add it to the Makefile, too.

 lib/report.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/report.c b/lib/report.c
index b002d21..c0a701f 100644
--- a/lib/report.c
+++ b/lib/report.c
@@ -81,9 +81,9 @@ void report_prefix_pop(void)
 static void va_report(const char *msg_fmt,
 		bool pass, bool xfail, bool skip, va_list va)
 {
-	char *prefix = skip ? "SKIP"
-	                    : xfail ? (pass ? "XPASS" : "XFAIL")
-	                            : (pass ? "PASS"  : "FAIL");
+	const char *prefix = skip ? "SKIP"
+				  : xfail ? (pass ? "XPASS" : "XFAIL")
+				  : (pass ? "PASS"  : "FAIL");
 
 	spin_lock(&lock);
 
-- 
1.8.3.1




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux