Re: [PATCH 2/2] media: iris: Add support for QC08C format for encoder

Bryan O'Donoghue
2025-09-24T13:31:45Z

On 24/09/2025 13:40, Markus Elfring wrote:
> …
>> +++ b/drivers/media/platform/qcom/iris/iris_buffer.c
>> @@ -171,9 +171,14 @@ static u32 iris_yuv_buffer_size_nv12(struct iris_inst *inst)
>> static u32 iris_yuv_buffer_size_qc08c(struct iris_inst *inst)
>> {
>> u32 y_plane, uv_plane, y_stride, uv_stride;
>> - struct v4l2_format *f = inst->fmt_dst;
>> u32 uv_meta_stride, uv_meta_plane;
>> u32 y_meta_stride, y_meta_plane;
>> + struct v4l2_format *f = NULL;
>> +
>> + if (inst->domain == DECODER)
>> + f = inst->fmt_dst;
>> + else
>> + f = inst->fmt_src;
> …
>
> How do you think about to use a source code variant like the following?
>
> struct v4l2_format *f = (inst->domain == DECODER) ? inst->fmt_dst : inst->fmt_src;
>
>
> Regards,
> Markus

My personal preference is for if / else as above.

Trying to encourage the Iris people to move away from ternary operators ...

---
bod