From patchwork Wed May 24 21:31:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: David Matlack X-Patchwork-Id: 9746971 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D9C7460246 for ; Wed, 24 May 2017 21:31:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CC0F026E47 for ; Wed, 24 May 2017 21:31:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C058426E4E; Wed, 24 May 2017 21:31:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6D78926E47 for ; Wed, 24 May 2017 21:31:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S941089AbdEXVbt (ORCPT ); Wed, 24 May 2017 17:31:49 -0400 Received: from mail-pf0-f179.google.com ([209.85.192.179]:35105 "EHLO mail-pf0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S941010AbdEXVbs (ORCPT ); Wed, 24 May 2017 17:31:48 -0400 Received: by mail-pf0-f179.google.com with SMTP id n23so147239236pfb.2 for ; Wed, 24 May 2017 14:31:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=GwY6qZLJknS3S07DwIjctkVvag878MoRx8R2NTBaSqg=; b=DwYizOgaowPJIu94wvXC0HZiT5llNmBxBndPeAjH3CFx0uxLBGf6wUU07FdEXcQaAZ eOOxDM/DIFB+GrvEzXhBXKTSmtu1pXUPoMpmhgpgSLq7Kwg8Wz/Ckv6puzDctLTecRLi Ln+0ejWtVdGpBrhAZ1WMtVz0E01DrqU0FVlMBLHkiPAkEEuTFw2EHFSP/NDg8a3VgMQ8 E+6CCyX8qrwrJYu5tF72Pj5HcpMgFMyckFe866cr4LtZdxDugSv6aElVipUS9cArUDjA 2AYLGM0pRqaHe0ggc/32pXDT6tLyGg/KIo0AaC0O2GZQ64o1uhOY8DF6avIoA/ChEgs0 1AOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=GwY6qZLJknS3S07DwIjctkVvag878MoRx8R2NTBaSqg=; b=PUeedC7IAqb/kgKehaA7868EQZe2tzAhNlFRjLvoK8FcGD0WbgNtGr9olRuvXZQB61 EcVmN0xCRL89jS3Ilyf5xE464qq8ut6yc+fJTWFqT6R9D3A0GsALeeZPnDDcfRXd9eSV oQf5OORakA9aSKbUELpJlcbpvlj3PV3BXALdBkDH52D/3WIbRdGhPYpCdPDxtcuobD0S 3AfzM3JzSgsu87BQTJEdR80g47r8tU/di2VxJBVB4kFoWyur76VEaUXsIeoW8AN1uSt3 qtYP8zwMBg035VZDQcm7/xvmhBQ0T8ngfbrnJKViyXJjI8ZLpDAQEx2efdkrAfyeWnXD QH5Q== X-Gm-Message-State: AODbwcA2xNDh2EpxUG6NVM6mDgwkUCp4AU6Gu6vxclo+fjujYbhmKgzA Cr3e1VbzLhGtzxO5 X-Received: by 10.84.179.193 with SMTP id b59mr46374419plc.3.1495661507396; Wed, 24 May 2017 14:31:47 -0700 (PDT) Received: from dmatlack.sea.corp.google.com ([100.100.206.82]) by smtp.gmail.com with ESMTPSA id u9sm8580429pgn.55.2017.05.24.14.31.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 24 May 2017 14:31:46 -0700 (PDT) From: David Matlack To: kvm@vger.kernel.org Cc: jmattson@google.com, David Matlack Subject: [kvm-unit-tests PATCH 1/3] x86: fix "format not a string literal" errors Date: Wed, 24 May 2017 14:31:21 -0700 Message-Id: <20170524213123.71538-1-dmatlack@google.com> X-Mailer: git-send-email 2.13.0.219.gdb65acc882-goog MIME-Version: 1.0 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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);