|
From: | Cao jin |
Subject: | Re: [Qemu-devel] [PULL 10/11] Add Error **errp for xen_pt_config_init() |
Date: | Sat, 23 Jan 2016 20:23:54 +0800 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 |
On 01/22/2016 07:21 PM, Paolo Bonzini wrote:
On 21/01/2016 18:01, Stefano Stabellini wrote:- XEN_PT_LOG(&s->dev, "Failed to initialize %d/%ld reg 0x%x in grp_type=0x%x (%d/%ld), rc=%d\n", - j, ARRAY_SIZE(xen_pt_emu_reg_grps[i].emu_regs), - regs->offset, xen_pt_emu_reg_grps[i].grp_type, - i, ARRAY_SIZE(xen_pt_emu_reg_grps), rc); + 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),Coverity noticed a preexisting problem here. emu_regs is a pointer, thus ARRAY_SIZE doesn't return what you expect.
Hi stefano,Seems ARRAY_SIZE(xen_pt_emu_reg_grps[i].emu_regs) is not important err message to regular users, and I guess it still can help developer to debug even without it. So, do you think it is ok to remove it? Or any better idea?
Paolo
-- Yours Sincerely, Cao jin
[Prev in Thread] | Current Thread | [Next in Thread] |