[Spice-devel] [spice-gtk 2/2] win-usb-dev: Use 'stable' libusb_device pointers in GUdevClient::udev_list
Christophe Fergeau
cfergeau at redhat.com
Wed Mar 27 14:56:14 UTC 2019
Hey,
On Wed, Mar 27, 2019 at 10:48:45AM +0200, Yuri Benditovich wrote:
> On Tue, Mar 26, 2019 at 3:11 PM Christophe Fergeau <cfergeau at redhat.com> wrote:
> >
> > On Mon, Mar 25, 2019 at 08:03:05PM +0200, Yuri Benditovich wrote:
> > > Yes, it looks like this finally does the same thing.
> >
> > > From my personal point of view, this is less obvious than previous
> > > code, so I would add 2 comments:
> > > that we unreference the device from the new list
> > > that we add reference to the device from the old list, it will be
> > > dereferenced on next line when the old list freed
> >
> > If the part you find less clear is:
> > + libusb_unref_device(dev->data);
> > + dev->data = libusb_ref_device(found->data);
> >
>
> Yes, it is. It took me some time to understand the intention, so I suppose
> some other (not too smart) readers will also need some thinking and
> the comments would make the reading easier.
> Again, this is my personal opinion, no objections as soon as the code
> does the same thing.
And it took me some time to understand the intention of the swap when
reviewing your code ;) I changed it back to your initial version, and
pushed the whole series!
Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20190327/0b0e9a07/attachment.sig>
More information about the Spice-devel
mailing list