Re: [PATCH 1/1] staging: usbip: remove an unnecessary lock in usbip_event_happened. The variable "happened" is local. So I think there is no need to lock here.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

>         int happened = 0;
>
> -       spin_lock(&ud->lock);
>         if (ud->event != 0)
>                 happened = 1;
> -       spin_unlock(&ud->lock);
>
>         return happened;

I am guessing locking was intended to protect ud->event along with
happened so that (checking the value of ud->event and setting value of
happened) was atomic.

return ud->event != 0 ? 1 : 0;

Regards.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux