Re: [PATCH 2/4] media: atomisp: queue: remove unused local queue support

From: Andy Shevchenko

Date: Tue Oct 13 2026 - 13:09:19 EST


On Mon, Oct 12, 2026 at 11:07:51PM +0000, Rareș-Mihai Vladu wrote:
> ia_css_queue_local_init() has no callers, so IA_CSS_QUEUE_TYPE_LOCAL
> is never set and every local queue branch in queue.c is unreachable.
> ia_css_queue_uninit() only tore down local queues and has no callers
> either.
>
> Remove both functions, the local branches, struct ia_css_queue_local
> and the local member of the struct ia_css_queue union. Only remote
> queues, shared with the SP firmware, are used by the driver.

...

> /* Queue type specifier */
> /* Avoiding enums to save space */
> -#define IA_CSS_QUEUE_TYPE_LOCAL 0
> #define IA_CSS_QUEUE_TYPE_REMOTE 1

This is a slippery slope. 0 can be default by implicit zeroed data type, so you
need to really carefully check all call sites that use qhandle and/or allocate
it. Since there are two possible values only, the IA_CSS_QUEUE_TYPE_REMOTE
must gone together (in case this patch is proved to be correct). TL;DR: there
is more homework to do and clean up more at the end.

...

> struct ia_css_queue {
> - u8 type; /* Specify remote/local type of access */
> + u8 type; /* Specify remote type of access */

This is FW interface, I don't think we may drop the comment above.

> u8 location; /* Cell location for queue */
> u8 proc_id; /* Processor id for queue access */
> union {
> - ia_css_circbuf_t cb_local;

Not sure about this, but since it's union the only thing to check is
the sizeof(struct ia_css_queue) to be the same after removal.

> struct {
> u32 cb_desc_addr; /*Circbuf desc address for remote queues*/
> u32 cb_elems_addr; /*Circbuf elements addr for remote queue*/

--
With Best Regards,
Andy Shevchenko