From patchwork Fri Aug 12 23:36:09 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 9278131 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 F195C600CB for ; Fri, 12 Aug 2016 23:36:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E36F628B26 for ; Fri, 12 Aug 2016 23:36:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D7F7B28B2B; Fri, 12 Aug 2016 23:36:50 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4CDF528B26 for ; Fri, 12 Aug 2016 23:36:50 +0000 (UTC) Received: from localhost ([::1]:55270 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bYM0P-0005ym-7L for patchwork-qemu-devel@patchwork.kernel.org; Fri, 12 Aug 2016 19:36:49 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44917) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bYLzv-0005xI-15 for qemu-devel@nongnu.org; Fri, 12 Aug 2016 19:36:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bYLzr-0000HI-Ml for qemu-devel@nongnu.org; Fri, 12 Aug 2016 19:36:18 -0400 Received: from mail.kernel.org ([198.145.29.136]:41334) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bYLzr-0000HE-Ga for qemu-devel@nongnu.org; Fri, 12 Aug 2016 19:36:15 -0400 Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 13B3520131; Fri, 12 Aug 2016 23:36:14 +0000 (UTC) Received: from sstabellini-ThinkPad-X260.hsd1.ca.comcast.net (unknown [96.82.76.110]) (using TLSv1.2 with cipher AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E319D200F3; Fri, 12 Aug 2016 23:36:12 +0000 (UTC) From: Stefano Stabellini To: peter.maydell@linaro.org Date: Fri, 12 Aug 2016 16:36:09 -0700 Message-Id: <1471044970-9229-1-git-send-email-sstabellini@kernel.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: References: X-Virus-Scanned: ClamAV using ClamSMTP X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 198.145.29.136 Subject: [Qemu-devel] [PULL 1/2] Xen: fix converity warning of xen_pt_config_init() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: xen-devel@lists.xenproject.org, Cao jin , sstabellini@kernel.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Cao jin emu_regs is a pointer, ARRAY_SIZE doesn't return what we expect. Since the remaining message is enough for debugging, so just remove it. Also tweaked the message a little. Signed-off-by: Cao jin --- hw/xen/xen_pt_config_init.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/hw/xen/xen_pt_config_init.c b/hw/xen/xen_pt_config_init.c index 9869ffd..6f18366 100644 --- a/hw/xen/xen_pt_config_init.c +++ b/hw/xen/xen_pt_config_init.c @@ -2049,9 +2049,8 @@ void xen_pt_config_init(XenPCIPassthroughState *s, Error **errp) for (j = 0; regs->size != 0; j++, regs++) { xen_pt_config_reg_init(s, reg_grp_entry, regs, &err); if (err) { - error_append_hint(&err, "Failed to initialize %d/%zu" - " reg 0x%x in grp_type = 0x%x (%d/%zu)", - j, ARRAY_SIZE(xen_pt_emu_reg_grps[i].emu_regs), + error_append_hint(&err, "Failed to init register %d" + " offsets 0x%x in grp_type = 0x%x (%d/%zu)", j, regs->offset, xen_pt_emu_reg_grps[i].grp_type, i, ARRAY_SIZE(xen_pt_emu_reg_grps)); error_propagate(errp, err);