mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bryan O'Donoghue <bod@kernel.org>
To: Ricardo Ribalda <ribalda@chromium.org>,
	Keke Li <keke.li@amlogic.com>,
	Jacopo Mondi <jacopo.mondi@ideasonboard.com>,
	Daniel Scally <dan.scally@ideasonboard.com>,
	Hans Verkuil <hverkuil+cisco@kernel.org>,
	Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>,
	Vikash Garodia <vikash.garodia@oss.qualcomm.com>,
	Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>,
	Abhinav Kumar <abhinav.kumar@linux.dev>,
	Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: Sakari Ailus <sakari.ailus@linux.intel.com>,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-msm@vger.kernel.org
Subject: Re: [PATCH v3 1/2] media: iris: Document difference in size during allocation
Date: Wed, 14 Jan 2026 22:20:06 +0000	[thread overview]
Message-ID: <58561346-37c5-4cf6-b3e0-7da6d1aab405@kernel.org> (raw)
In-Reply-To: <20251223-warnings-6-19-v3-1-e8f56cb204ec@chromium.org>

On 23/12/2025 10:02, Ricardo Ribalda wrote:
> As we get ready for kzalloc checking for invalid sizes, let's add
> documentation for the cases where the size is different but valid.
> 
> This patch fixes this cocci warning:
> ./platform/qcom/iris/iris_hfi_gen2_command.c:1215:9-25: WARNING: casting value returned by memory allocation function to (struct iris_inst *) is useless.
> 
> Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
> ---
>   drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c | 7 ++++++-
>   1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c b/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c
> index f9129553209922fda548ca320494ae6ae797854c..c120ea3594fb5d0f40d6b9a7c67ffc28c42109f0 100644
> --- a/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c
> +++ b/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c
> @@ -1212,5 +1212,10 @@ void iris_hfi_gen2_command_ops_init(struct iris_core *core)
> 
>   struct iris_inst *iris_hfi_gen2_get_instance(void)
>   {
> -	return (struct iris_inst *)kzalloc(sizeof(struct iris_inst_hfi_gen2), GFP_KERNEL);
> +	struct iris_inst_hfi_gen2 *out;
> +
> +	/* The allocation is intentionally larger than struct iris_inst. */
> +	out = kzalloc(sizeof(*out), GFP_KERNEL);
> +
> +	return &out->inst;
>   }
> 
> --
> 2.52.0.358.g0dd7633a29-goog
> 
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>

---
bod

  reply	other threads:[~2026-01-14 22:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-23 10:02 [PATCH v3 0/2] media: Fix CI warnings for 6.19 Ricardo Ribalda
2025-12-23 10:02 ` [PATCH v3 1/2] media: iris: Document difference in size during allocation Ricardo Ribalda
2026-01-14 22:20   ` Bryan O'Donoghue [this message]
2025-12-23 10:02 ` [PATCH v3 2/2] media: iris: Fix fps calculation 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=58561346-37c5-4cf6-b3e0-7da6d1aab405@kernel.org \
    --to=bod@kernel.org \
    --cc=abhinav.kumar@linux.dev \
    --cc=dan.scally@ideasonboard.com \
    --cc=dikshita.agarwal@oss.qualcomm.com \
    --cc=hverkuil+cisco@kernel.org \
    --cc=jacopo.mondi@ideasonboard.com \
    --cc=keke.li@amlogic.com \
    --cc=laurent.pinchart+renesas@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=ribalda@chromium.org \
    --cc=sakari.ailus@linux.intel.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

all inboxes | Powered by JetHome®