qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v1 1/1] virtio-snd: add max size bounds check in input cb


From: Manos Pitsidianakis
Subject: Re: [PATCH v1 1/1] virtio-snd: add max size bounds check in input cb
Date: Mon, 08 Jul 2024 12:29:43 +0300
User-agent: meli 0.8.6

Thanks for the review Philippe,

On Mon, 08 Jul 2024 11:28, Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
+ max_size = iov_size(buffer->elem->in_sg, buffer->elem->in_num);
              for (;;) {
+                if (buffer->size >= max_size) {
+                    return_rx_buffer(stream, buffer);

return_rx_buffer() could be renamed
flush_input_stream_to_buffer() for clarity.


return_rx_buffer() is vague but I think flush_input_stream_to_buffer() is more vague 🤔. I tried to use short names as much as possible and document the purpose in doc comments. Unfortunately the device's state machine is complex so the code complexity is necessary :/

Manos



reply via email to

[Prev in Thread] Current Thread [Next in Thread]