Re: [PATCH v4 3/5] usb: add apis for sideband uasge tracking
From: Guan-Yu Lin
Date: Wed Oct 09 2024 - 07:36:47 EST
On Wed, Oct 9, 2024 at 3:33 PM Amadeusz Sławiński
<amadeuszx.slawinski@xxxxxxxxxxxxxxx> wrote:
>
> On 10/9/2024 7:42 AM, Guan-Yu Lin wrote:
> >
> > +void usb_sideband_get(struct usb_device *udev)
> > +{
> > + struct usb_device *parent = udev;
>
> Is it really "parent" in this case? Perhaps better variable name would
> just be "device".
>
Thanks for the heads-up, will change it to "device" in the next patchset.
> > +
> > + do {
> > + atomic_inc(&parent->sb_usage_count);
> > + parent = parent->parent;
> > + } while (parent);
> > +}
> > +EXPORT_SYMBOL_GPL(usb_sideband_get);
> > +
>
> Similarly here.
>
> > +
> > + do {
> > + atomic_dec(&parent->sb_usage_count);
> > + parent = parent->parent;
> > + } while (parent);
> > +}
> > +EXPORT_SYMBOL_GPL(usb_sideband_put);
> > +
Regards,
Guan-Yu