Richard W.M. Jones
2022-Sep-03 16:25 UTC
[Libguestfs] [libnbd PATCH 1/4] internal: Track traffic stats
On Fri, Sep 02, 2022 at 05:14:22PM -0500, Eric Blake wrote:> #ifdef DUMP_PACKETS > - if (h->rbuf != NULL) > - nbd_internal_hexdump (h->rbuf, r, stderr); > + nbd_internal_hexdump (h->rbuf, r, stderr);Should this be a separate patch? I guess the assertion here is that h->rbuf is set to an address earlier in the function so it can never be NULL. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-builder quickly builds VMs from scratch http://libguestfs.org/virt-builder.1.html
Eric Blake
2022-Sep-03 18:26 UTC
[Libguestfs] [libnbd PATCH 1/4] internal: Track traffic stats
On Sat, Sep 03, 2022 at 05:25:11PM +0100, Richard W.M. Jones wrote:> On Fri, Sep 02, 2022 at 05:14:22PM -0500, Eric Blake wrote: > > #ifdef DUMP_PACKETS > > - if (h->rbuf != NULL) > > - nbd_internal_hexdump (h->rbuf, r, stderr); > > + nbd_internal_hexdump (h->rbuf, r, stderr); > > Should this be a separate patch? I guess the assertion here is that > h->rbuf is set to an address earlier in the function so it can never > be NULL.Correct on both counts: I noticed it while touching the function; the 'if' is dead code becaues of earlier in the function, but a separate patch is worthwhile. -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org