Skip to contentSkip to conversation

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

PATCH In review Prajval Chaudhary 2 participants 2 messages Jul 18 – Jul 19

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: media: atomisp: use sizeof(*pointer) in vzalloc

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.

---
 drivers/staging/media/atomisp/pci/atomisp_compat_css20.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/media/atomisp/pci/atomisp_compat_css20.c +2 -2
index 0ee52637ea30..ea49ebe2da5c 100644
@@ -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;
 
Signature · 1 line
2.34.1
#1 lore raw
Quoted 6 lines · Prajval Chaudhary

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.

Signature · 2 lines
With Best Regards,
Andy Shevchenko