From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cao jin Subject: Re: [PULL 10/11] Add Error **errp for xen_pt_config_init() Date: Sat, 23 Jan 2016 20:23:54 +0800 Message-ID: <56A370DA.7030205@cn.fujitsu.com> References: <1453395690-32660-10-git-send-email-stefano.stabellini@eu.citrix.com> <56A210C4.9040407@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <56A210C4.9040407@redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org Sender: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org To: Paolo Bonzini , Stefano Stabellini , peter.maydell@linaro.org Cc: xen-devel@lists.xensource.com, qemu-devel@nongnu.org List-Id: xen-devel@lists.xenproject.org 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