Skip to contentSkip to conversation

staging: vc04_services: Use ARRAY_SIZE macro

PATCH New Gargi Sharma 1 participant 1 message Mar 8, 2017

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

PATCH 1/1 staging: vc04_services: Use ARRAY_SIZE macro

Use ARRAY_SIZE to calculate the size of an array.
The semantic patch used can be found here:
https://github.com/coccinelle/coccinellery/blob/master/arraysize/array.cocci

---
 drivers/staging/vc04_services/interface/vchiq_arm/vchiq_debugfs.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_debugfs.c +1 -3
index f07cd44..3d87ce3 100644
@@ -81,9 +81,7 @@ static struct vchiq_debugfs_log_entry vchiq_debugfs_log_entries[] = {
 	{ "susp", &vchiq_susp_log_level },
 	{ "arm",  &vchiq_arm_log_level },
 };
-static int n_log_entries =
-	sizeof(vchiq_debugfs_log_entries)/sizeof(vchiq_debugfs_log_entries[0]);
-
+static int n_log_entries = ARRAY_SIZE(vchiq_debugfs_log_entries);
 
 static struct dentry *vchiq_clients_top(void);
 static struct dentry *vchiq_debugfs_top(void);
Signature · 1 line
2.7.4