All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] Xen: fix converity warning of xen_pt_config_init()
@ 2016-01-25 12:16 Cao jin
  2016-08-11 18:11 ` Peter Maydell
  0 siblings, 1 reply; 3+ messages in thread
From: Cao jin @ 2016-01-25 12:16 UTC (permalink / raw)
  To: qemu-devel; +Cc: stefano.stabellini

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 <caoj.fnst@cn.fujitsu.com>
---
 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 81c6721..e505438 100644
--- a/hw/xen/xen_pt_config_init.c
+++ b/hw/xen/xen_pt_config_init.c
@@ -2047,9 +2047,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);
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] Xen: fix converity warning of xen_pt_config_init()
  2016-01-25 12:16 [Qemu-devel] [PATCH] Xen: fix converity warning of xen_pt_config_init() Cao jin
@ 2016-08-11 18:11 ` Peter Maydell
  2016-08-11 19:18   ` Stefano Stabellini
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Maydell @ 2016-08-11 18:11 UTC (permalink / raw)
  To: QEMU Developers; +Cc: Stefano Stabellini, Cao jin

Hi Stefano -- just a ping on this patch from January -- I have a feeling
it maybe got lost in your change of email address?

(I noticed looking through coverity reports that this one was unfixed
and found Cao Jin's patch in the list archive.)

thanks
-- PMM


On 25 January 2016 at 12:16, Cao jin <caoj.fnst@cn.fujitsu.com> wrote:
> 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 <caoj.fnst@cn.fujitsu.com>
> ---
>  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 81c6721..e505438 100644
> --- a/hw/xen/xen_pt_config_init.c
> +++ b/hw/xen/xen_pt_config_init.c
> @@ -2047,9 +2047,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);
> --
> 2.1.0

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] Xen: fix converity warning of xen_pt_config_init()
  2016-08-11 18:11 ` Peter Maydell
@ 2016-08-11 19:18   ` Stefano Stabellini
  0 siblings, 0 replies; 3+ messages in thread
From: Stefano Stabellini @ 2016-08-11 19:18 UTC (permalink / raw)
  To: Peter Maydell; +Cc: QEMU Developers, Stefano Stabellini, Cao jin

Well spotted, thanks Peter!

It looks OK and has passed my tests, I'll send it in the next pull
request.

On Thu, 11 Aug 2016, Peter Maydell wrote:
> Hi Stefano -- just a ping on this patch from January -- I have a feeling
> it maybe got lost in your change of email address?
> 
> (I noticed looking through coverity reports that this one was unfixed
> and found Cao Jin's patch in the list archive.)
> 
> thanks
> -- PMM
> 
> 
> On 25 January 2016 at 12:16, Cao jin <caoj.fnst@cn.fujitsu.com> wrote:
> > 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 <caoj.fnst@cn.fujitsu.com>
> > ---
> >  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 81c6721..e505438 100644
> > --- a/hw/xen/xen_pt_config_init.c
> > +++ b/hw/xen/xen_pt_config_init.c
> > @@ -2047,9 +2047,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);
> > --
> > 2.1.0
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-08-11 19:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-25 12:16 [Qemu-devel] [PATCH] Xen: fix converity warning of xen_pt_config_init() Cao jin
2016-08-11 18:11 ` Peter Maydell
2016-08-11 19:18   ` Stefano Stabellini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.