[PATCH] staging: media: atomisp: use sizeof(*pointer) in vzalloc

Prajval Chaudhary posted 1 patch 6 days, 10 hours ago
drivers/staging/media/atomisp/pci/atomisp_compat_css20.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
[PATCH] staging: media: atomisp: use sizeof(*pointer) in vzalloc
Posted by Prajval Chaudhary 6 days, 10 hours ago
Fix checkpatch style warnings by replacing explicit 'sizeof(struct ...)'
types with 'sizeof(*pointer)' inside vzalloc allocations. This aligns
the code with modern kernel coding style standards and ensures the
allocations automatically adapt if the pointer's structure type changes
in the future.

Signed-off-by: Prajval Chaudhary <prajvalchaudhari733@gmail.com>
---
 drivers/staging/media/atomisp/pci/atomisp_compat_css20.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c b/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c
index 0ee52637ea30..ea49ebe2da5c 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c
+++ b/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c
@@ -2873,7 +2873,7 @@ int atomisp_css_get_ctc_table(struct atomisp_sub_device *asd,
 		return -EINVAL;
 	}
 
-	tab = vzalloc(sizeof(struct ia_css_ctc_table));
+	tab = vzalloc(sizeof(*tab));
 	if (!tab)
 		return -ENOMEM;
 
@@ -2901,7 +2901,7 @@ int atomisp_css_get_gamma_table(struct atomisp_sub_device *asd,
 		return -EINVAL;
 	}
 
-	tab = vzalloc(sizeof(struct ia_css_gamma_table));
+	tab = vzalloc(sizeof(*tab));
 	if (!tab)
 		return -ENOMEM;
 
-- 
2.34.1
Re: [PATCH] staging: media: atomisp: use sizeof(*pointer) in vzalloc
Posted by Andy Shevchenko 5 days, 19 hours ago
On Sat, Jul 18, 2026 at 8:42 PM Prajval Chaudhary
<prajvalchaudhari733@gmail.com> wrote:
>
> Fix checkpatch style warnings by replacing explicit 'sizeof(struct ...)'
> types with 'sizeof(*pointer)' inside vzalloc allocations. This aligns
> the code with modern kernel coding style standards and ensures the
> allocations automatically adapt if the pointer's structure type changes
> in the future.

Unneeded churn. Is it for some kind of training session?
There are more desired activities that newbies can perform against this driver.

-- 
With Best Regards,
Andy Shevchenko