From: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
To: Ricardo Ribalda <ribalda@chromium.org>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Vikash Garodia <vikash.garodia@oss.qualcomm.com>,
Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>,
Abhinav Kumar <abhinav.kumar@linux.dev>,
Shuah Khan <skhan@linuxfoundation.org>,
Kieran Bingham <kieran.bingham@ideasonboard.com>,
Bin Du <bin.du@amd.com>,
Nirujogi Pratap <pratap.nirujogi@amd.com>,
Sultan Alsawaf <sultan@kerneltoast.com>,
Svetoslav Stoilov <Svetoslav.Stoilov@amd.com>,
Sakari Ailus <sakari.ailus@linux.intel.com>,
Abylay Ospan <aospan@amazon.com>
Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-msm@vger.kernel.org
Subject: Re: [PATCH 2/9] media: iris: Replace ternary conditionals with max()
Date: Mon, 29 Jun 2026 14:51:35 +0100 [thread overview]
Message-ID: <cda4aeef-e4ef-47da-a171-4116ecf79af5@linaro.org> (raw)
In-Reply-To: <20260629-cocci-7-2-v1-2-5884c80ee3b6@chromium.org>
On 29/06/2026 12:30, Ricardo Ribalda wrote:
> The max() macro is simpler to read than the current construction, it
> also makes cocci happier, which currently throws these warnings:
>
> ./platform/qcom/iris/iris_vpu_buffer.c:703:13-15: WARNING opportunity for max()
> ./platform/qcom/iris/iris_vpu_buffer.c:583:23-25: WARNING opportunity for max()
>
> Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
> ---
> drivers/media/platform/qcom/iris/iris_vpu_buffer.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/media/platform/qcom/iris/iris_vpu_buffer.c b/drivers/media/platform/qcom/iris/iris_vpu_buffer.c
> index fb6f1016415e..faebb5472866 100644
> --- a/drivers/media/platform/qcom/iris/iris_vpu_buffer.c
> +++ b/drivers/media/platform/qcom/iris/iris_vpu_buffer.c
> @@ -580,7 +580,7 @@ static u32 hfi_buffer_line_av1d(u32 frame_width, u32 frame_height,
> ALIGN(size_av1d_qp(frame_width, frame_height), DMA_ALIGNMENT);
> opbwr8 = size_av1d_lb_opb_wr1_nv12_ubwc(frame_width, frame_height);
> opbwr10 = size_av1d_lb_opb_wr1_tp10_ubwc(frame_width, frame_height);
> - opbwrbufsize = opbwr8 >= opbwr10 ? opbwr8 : opbwr10;
> + opbwrbufsize = max(opbwr8, opbwr10);
> size = ALIGN((size + opbwrbufsize), DMA_ALIGNMENT);
> if (is_opb) {
> vpss_lb_size = size_vpss_lb(frame_width, frame_height);
> @@ -700,7 +700,7 @@ static u32 hfi_buffer_ibc_av1d(u32 frame_width, u32 frame_height)
>
> ibc8 = size_av1d_ibc_nv12_ubwc(frame_width, frame_height);
> ibc10 = size_av1d_ibc_tp10_ubwc(frame_width, frame_height);
> - size = ibc8 >= ibc10 ? ibc8 : ibc10;
> + size = max(ibc8, ibc10);
>
> return ALIGN(size, DMA_ALIGNMENT);
> }
>
> --
> 2.55.0.rc0.799.gd6f94ed593-goog
>
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
bod
next prev parent reply other threads:[~2026-06-29 13:51 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-29 11:30 [PATCH 0/9] media: Fix all missing cocci warnings Ricardo Ribalda
2026-06-29 11:30 ` [PATCH 1/9] media: em28xx-video: Remove unneeded semicolons Ricardo Ribalda
2026-06-29 11:30 ` [PATCH 2/9] media: iris: Replace ternary conditionals with max() Ricardo Ribalda
2026-06-29 13:51 ` Bryan O'Donoghue [this message]
2026-06-29 11:30 ` [PATCH 3/9] media: vimc: Fix prototype of vimc_sensor_update_frame_timing Ricardo Ribalda
2026-06-29 11:30 ` [PATCH 4/9] media: vimc: Ensure that pixel_rate fits in 32 bits Ricardo Ribalda
2026-06-29 11:30 ` [PATCH 5/9] media: platform: amd: use refcount_t instead of atomic_t Ricardo Ribalda
2026-06-29 15:51 ` Nirujogi, Pratap
2026-06-30 6:06 ` Bin Du
2026-06-29 11:30 ` [PATCH 6/9] media: dvb-frontends/helene: Rename priv variable Ricardo Ribalda
2026-06-29 11:30 ` [PATCH 7/9] media: drivers/media/dvb-core: Split dvb_frontend_open() Ricardo Ribalda
2026-06-29 11:30 ` [PATCH 8/9] media: drivers/media/dvb-core: Refactor dvb_frontend_open locking Ricardo Ribalda
2026-06-29 11:30 ` [PATCH 9/9] media: drivers/media/dvb-core: CodeStyle for dvb_frontend_open() Ricardo Ribalda
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=cda4aeef-e4ef-47da-a171-4116ecf79af5@linaro.org \
--to=bryan.odonoghue@linaro.org \
--cc=Svetoslav.Stoilov@amd.com \
--cc=abhinav.kumar@linux.dev \
--cc=aospan@amazon.com \
--cc=bin.du@amd.com \
--cc=dikshita.agarwal@oss.qualcomm.com \
--cc=kieran.bingham@ideasonboard.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=pratap.nirujogi@amd.com \
--cc=ribalda@chromium.org \
--cc=sakari.ailus@linux.intel.com \
--cc=skhan@linuxfoundation.org \
--cc=sultan@kerneltoast.com \
--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
Powered by JetHome