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: 9278137 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 1B957600CB for ; Fri, 12 Aug 2016 23:38:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0DD0228B23 for ; Fri, 12 Aug 2016 23:38:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0255E28B2A; Fri, 12 Aug 2016 23:38:35 +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=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8FBEB28B23 for ; Fri, 12 Aug 2016 23:38:35 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bYLzw-0004FZ-25; Fri, 12 Aug 2016 23:36:20 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bYLzt-0004F7-WE for xen-devel@lists.xenproject.org; Fri, 12 Aug 2016 23:36:18 +0000 Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id B6/1F-13924-17D5EA75; Fri, 12 Aug 2016 23:36:17 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrJLMWRWlGSWpSXmKPExsVybKJsh25B7Lp wg/dTTSy+b5nM5MDocfjDFZYAxijWzLyk/IoE1oy+c6eYC95yVXw+sIC5gfEoexcjF4eQwFRG id/b/0M5k5kkFm16ydTFyMnBJmAo8ffJJjYQW0RARqLz0iJGEJtZoEJi1vxTrF2MHBzCAm4SH cfkQMIsAqoS//a2gpXzCrhKPNzxDsyWEJCTOHlsMiuIzSngI7H4+xuw8UIC3hIND39B1WRIzO uZwwphe0ksunEJylaTuHpuE/MERr4FjAyrGNWLU4vKUot0DfWSijLTM0pyEzNzdA0NTPVyU4u LE9NTcxKTivWS83M3MQKDpJ6BgXEHY1Ov8yFGSQ4mJVFeHfN14UJ8SfkplRmJxRnxRaU5qcWH GGU4OJQkeNfEAOUEi1LTUyvSMnOA4QqTluDgURLhfQ6S5i0uSMwtzkyHSJ1iVJQS53UHSQiAJ DJK8+DaYDFyiVFWSpiXkYGBQYinILUoN7MEVf4VozgHo5IwbxDIFJ7MvBK46a+AFjMBLT5htg ZkcUkiQkqqgXEa++a66U/MJB+aKgcIpX23vb+mgf/Pff93rMLJvMECvO9t93cl8LKJN9TJz8y Zcsjyyes/v+YzpovfuHo8l6lq+Y93/ozXDNsNzhbLLrOZv3e95i6eltQJMR6CbC6Kx24fijs3 7XTORu7L7IImSkqbohj/LotoEw6xNxA8+e/3oie7CqK53yuxFGckGmoxFxUnAgB6WW5yjAIAA A== X-Env-Sender: sstabellini@kernel.org X-Msg-Ref: server-14.tower-206.messagelabs.com!1471044975!17924520!1 X-Originating-IP: [198.145.29.136] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.84; banners=-,-,- X-VirusChecked: Checked Received: (qmail 2970 invoked from network); 12 Aug 2016 23:36:16 -0000 Received: from mail.kernel.org (HELO mail.kernel.org) (198.145.29.136) by server-14.tower-206.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 12 Aug 2016 23:36:16 -0000 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 Cc: xen-devel@lists.xenproject.org, Cao jin , sstabellini@kernel.org, qemu-devel@nongnu.org Subject: [Xen-devel] [PULL 1/2] Xen: fix converity warning of xen_pt_config_init() X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-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);