* [PATCH] staging: media: atomisp: use kvmalloc_objs() in make_histogram()
@ 2026-06-09 21:46 Rodrigo Gobbi
2026-06-10 13:36 ` Andy Shevchenko
0 siblings, 1 reply; 2+ messages in thread
From: Rodrigo Gobbi @ 2026-06-09 21:46 UTC (permalink / raw)
To: andy, hansg, mchehab, sakari.ailus, gregkh, feng
Cc: ~lkcamp/patches, linux-kernel-mentees, linux-kernel, linux-media,
linux-staging
Replace kvmalloc() with multiply with kvmalloc_objs(), which handles
the size multiplication internally with overflow checking, silenting
checkpatch warn.
Signed-off-by: Rodrigo Gobbi <rodrigo.gobbi.7@gmail.com>
---
Hi, all,
There is a ongoing effort like this for other files from atomisp
at [1], yet, it is not covering the same file.
Tks and regards.
[1] https://lore.kernel.org/all/20260413112904.98864-1-feng@innora.ai/
---
drivers/staging/media/atomisp/pci/sh_css_metrics.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/staging/media/atomisp/pci/sh_css_metrics.c b/drivers/staging/media/atomisp/pci/sh_css_metrics.c
index edf473dd86ca..d3ae737f1764 100644
--- a/drivers/staging/media/atomisp/pci/sh_css_metrics.c
+++ b/drivers/staging/media/atomisp/pci/sh_css_metrics.c
@@ -59,16 +59,13 @@ make_histogram(struct sh_css_pc_histogram *histogram, unsigned int length)
return;
if (histogram->run)
return;
- histogram->run = kvmalloc(length * sizeof(*histogram->run),
- GFP_KERNEL);
+ histogram->run = kvmalloc_objs(*histogram->run, length);
if (!histogram->run)
return;
- histogram->stall = kvmalloc(length * sizeof(*histogram->stall),
- GFP_KERNEL);
+ histogram->stall = kvmalloc_objs(*histogram->stall, length);
if (!histogram->stall)
return;
- histogram->msink = kvmalloc(length * sizeof(*histogram->msink),
- GFP_KERNEL);
+ histogram->msink = kvmalloc_objs(*histogram->msink, length);
if (!histogram->msink)
return;
--
2.48.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] staging: media: atomisp: use kvmalloc_objs() in make_histogram()
2026-06-09 21:46 [PATCH] staging: media: atomisp: use kvmalloc_objs() in make_histogram() Rodrigo Gobbi
@ 2026-06-10 13:36 ` Andy Shevchenko
0 siblings, 0 replies; 2+ messages in thread
From: Andy Shevchenko @ 2026-06-10 13:36 UTC (permalink / raw)
To: Rodrigo Gobbi
Cc: andy, hansg, mchehab, sakari.ailus, gregkh, feng,
~lkcamp/patches, linux-kernel-mentees, linux-kernel, linux-media,
linux-staging
On Tue, Jun 09, 2026 at 06:46:31PM -0300, Rodrigo Gobbi wrote:
> Replace kvmalloc() with multiply with kvmalloc_objs(), which handles
> the size multiplication internally with overflow checking, silenting
> checkpatch warn.
>
> Signed-off-by: Rodrigo Gobbi <rodrigo.gobbi.7@gmail.com>
> ---
> Hi, all,
> There is a ongoing effort like this for other files from atomisp
> at [1], yet, it is not covering the same file.
> Tks and regards.
>
> [1] https://lore.kernel.org/all/20260413112904.98864-1-feng@innora.ai/
Yeah, the problem is that the activity seems stale. Can you pickup all
the patches from the mailing list that have not been yet applied (regarding
k*alloc() uses) and combine them into series or so and update regarding to
Sakari's comments?
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-06-10 13:36 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-09 21:46 [PATCH] staging: media: atomisp: use kvmalloc_objs() in make_histogram() Rodrigo Gobbi
2026-06-10 13:36 ` Andy Shevchenko
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®