public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Bryan O'Donoghue <bod@kernel.org>
To: Markus Elfring <Markus.Elfring@web.de>,
	Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>,
	linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org
Cc: LKML <linux-kernel@vger.kernel.org>,
	Abhinav Kumar <abhinav.kumar@linux.dev>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Vikash Garodia <vikash.garodia@oss.qualcomm.com>
Subject: Re: [PATCH 2/2] media: iris: Add support for QC08C format for encoder
Date: Wed, 24 Sep 2025 14:31:41 +0100	[thread overview]
Message-ID: <908fece9-769b-4f44-86bb-04de7c3d510e@kernel.org> (raw)
In-Reply-To: <5c0f6b8e-c3cc-492c-9d94-3b79eaca0628@web.de>

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

  reply	other threads:[~2025-09-24 13:31 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-19 15:47 [PATCH 0/2] Add support for QC08C format in iris driver Dikshita Agarwal
2025-09-19 15:47 ` [PATCH 1/2] media: iris: Add support for QC08C format for decoder Dikshita Agarwal
2025-09-19 16:54   ` Dmitry Baryshkov
2025-09-24 10:54     ` Dikshita Agarwal
2025-09-24 16:23       ` Dmitry Baryshkov
2025-10-01  8:24         ` Dikshita Agarwal
2025-09-24 12:32   ` Markus Elfring
2025-09-24 15:50     ` Nicolas Dufresne
2025-09-24 13:28   ` Bryan O'Donoghue
2025-10-01  8:36     ` Neil Armstrong
2025-10-01 15:04       ` Bryan O'Donoghue
2025-10-06  6:21         ` Dikshita Agarwal
2025-10-06 10:18           ` Dmitry Baryshkov
2025-10-01  8:38     ` Dikshita Agarwal
2025-09-19 15:47 ` [PATCH 2/2] media: iris: Add support for QC08C format for encoder Dikshita Agarwal
2025-09-24 12:40   ` Markus Elfring
2025-09-24 13:31     ` Bryan O'Donoghue [this message]
2025-10-01  8:39 ` [PATCH 0/2] Add support for QC08C format in iris driver Neil Armstrong
2025-10-01  9:00   ` Dikshita Agarwal
2025-10-01 13:47   ` Nicolas Dufresne

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=908fece9-769b-4f44-86bb-04de7c3d510e@kernel.org \
    --to=bod@kernel.org \
    --cc=Markus.Elfring@web.de \
    --cc=abhinav.kumar@linux.dev \
    --cc=dikshita.agarwal@oss.qualcomm.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=vikash.garodia@oss.qualcomm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox