Re: [PATCH] HID: debug: fix the ring buffer implementation

From: Vladis Dronov
Date: Sat Jan 26 2019 - 10:44:43 EST


Hello, Oleg, all,

Thanks much, Oleg, these are really valuable additions:

> suspicious ;) if you add a comment the patch will be even better.

Great, will do.

> perhaps it make sense to move this check into the "if (kfifo_is_empty())"
> block.

Indeed, otherwise it kinda breaks the execution logic.

> is kfifo_is_empty() == T really possible here?

It looks like it is not. Reads are guarded by read_mutex and the only other
code which touches hid_debug_fifo is writer.

I will post v2 here soon. Lets see if it is ready for inclusion.

Best regards,
Vladis Dronov | Red Hat, Inc. | Product Security | Senior Software Engineer