public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: David Matlack <dmatlack@google.com>
To: kvm@vger.kernel.org
Cc: jmattson@google.com, David Matlack <dmatlack@google.com>
Subject: [kvm-unit-tests PATCH 1/3] x86: fix "format not a string literal" errors
Date: Wed, 24 May 2017 14:31:21 -0700	[thread overview]
Message-ID: <20170524213123.71538-1-dmatlack@google.com> (raw)

Fix the following two compilation errors:

x86/msr.c: In function ‘test_msr_rw’:
x86/msr.c:94:5: error: format not a string literal and no format arguments [-Werror=format-security]
     report(sptr, expected == r);
          ^

x8e/vmx.c: In function ‘test_vmx_caps’:
x86/vmx.c:1412:3: error: format not a string literal and no format arguments [-Werror=format-security]
   report(vmx_ctl_msr[n].name, ok);
      ^

Signed-off-by: David Matlack <dmatlack@google.com>
---
 x86/msr.c | 2 +-
 x86/vmx.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/x86/msr.c b/x86/msr.c
index ab97d21d3acb..1d4003144bb5 100644
--- a/x86/msr.c
+++ b/x86/msr.c
@@ -91,7 +91,7 @@ static void test_msr_rw(int msr_index, unsigned long long input, unsigned long l
         printf("testing %s: output = %#x:%#x expected = %#x:%#x\n", sptr,
                (u32)(r >> 32), (u32)r, (u32)(expected >> 32), (u32)expected);
     }
-    report(sptr, expected == r);
+    report("%s", expected == r, sptr);
 }
 
 static void test_syscall_lazy_load(void)
diff --git a/x86/vmx.c b/x86/vmx.c
index 13366180f514..9189a66759ec 100644
--- a/x86/vmx.c
+++ b/x86/vmx.c
@@ -1409,7 +1409,7 @@ static void test_vmx_caps(void)
 			ok = ctrl.clr == true_ctrl.clr;
 			ok = ok && ctrl.set == (true_ctrl.set | default1);
 		}
-		report(vmx_ctl_msr[n].name, ok);
+		report("%s", ok, vmx_ctl_msr[n].name);
 	}
 
 	fixed0 = rdmsr(MSR_IA32_VMX_CR0_FIXED0);
-- 
2.13.0.219.gdb65acc882-goog

             reply	other threads:[~2017-05-24 21:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-24 21:31 David Matlack [this message]
2017-05-24 21:31 ` [kvm-unit-tests PATCH 2/3] api: fix "ignoring return value" of posix_memalign errors David Matlack
2017-05-24 21:31 ` [kvm-unit-tests PATCH 3/3] api: add api binaries to .gitignore David Matlack
2017-06-07 14:24 ` [kvm-unit-tests PATCH 1/3] x86: fix "format not a string literal" errors Radim Krčmář

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170524213123.71538-1-dmatlack@google.com \
    --to=dmatlack@google.com \
    --cc=jmattson@google.com \
    --cc=kvm@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox