Re: [PATCH v4 2/5] media: atomisp: queue: move remote queue handling into helpers
From: Andy Shevchenko
Date: Thu Oct 29 2026 - 09:13:18 EST
On Tue, Oct 27, 2026 at 11:08:04PM +0000, Rareș-Mihai Vladu wrote:
> Move the remote queue branch of every queue operation into its own
> static helper, written the way the function is meant to look once the
> unused local queue support is gone, and call it from the existing
> function after the local branch.
>
> While at it, tidy up the moved code: drop the redundant parentheses
> and '!= 0' comparisons, use !ptr instead of comparing to NULL, and
> return the result of the final ia_css_queue_store() call directly.
>
> This prepares for removing the local queue support in the next patch
> and keeps that change easy to review. No functional change intended.
...
> +int ia_css_queue_enqueue(ia_css_queue_t *qhandle, uint32_t item)
> int ia_css_queue_dequeue(ia_css_queue_t *qhandle, uint32_t *item)
> int ia_css_queue_get_free_space(ia_css_queue_t *qhandle, uint32_t *size)
> int ia_css_queue_get_used_space(ia_css_queue_t *qhandle, uint32_t *size)
> int ia_css_queue_peek(ia_css_queue_t *qhandle, u32 offset, uint32_t *element)
> int ia_css_queue_get_size(ia_css_queue_t *qhandle, uint32_t *size)
This change is okay, just a comment for further possible cleanup.
Please, consider making driver use uXX/sXX types over uintXX_t/intXX_t
for the kernel-only code and the respective double underscore for ABI
data types (I'm not sure about firmware protocol, it's strictly speaking
an ABI, but sometimes we use internal types) — __uXX/__sXX.
Maybe not entire driver at once (can be tons of lines to change), but small
step first to check if the approach is correct.
--
With Best Regards,
Andy Shevchenko