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: 658897 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3sB1X42TVXz9stY for ; Sat, 13 Aug 2016 09:37:40 +1000 (AEST) Received: from localhost ([::1]:55275 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bYM1C-0006pa-AR for incoming@patchwork.ozlabs.org; Fri, 12 Aug 2016 19:37:38 -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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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);