Skip to contentSkip to conversation

x86/cache_info: use ARRAY_SIZE() in amd_l3_attrs()

PATCH In review Dan Carpenter 2 participants 3 messages Oct 2, 2012 – Oct 5, 2012

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

PATCH 1/1 x86/cache_info: use ARRAY_SIZE() in amd_l3_attrs()

Using ARRAY_SIZE() is more readable.

arch/x86/kernel/cpu/intel_cacheinfo.c +1 -1
index 9a7c90d..93c5451 100644
@@ -991,7 +991,7 @@ static struct attribute ** __cpuinit amd_l3_attrs(void)
 	if (attrs)
 		return attrs;
 
-	n = sizeof (default_attrs) / sizeof (struct attribute *);
+	n = ARRAY_SIZE(default_attrs);
 
 	if (amd_nb_has_feature(AMD_NB_L3_INDEX_DISABLE))
 		n += 2;
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Dan Carpenter

Using ARRAY_SIZE() is more readable.

Regards,
Srivatsa S. Bhat

Quoted 14 lines
arch/x86/kernel/cpu/intel_cacheinfo.c +1 -1
index 9a7c90d..93c5451 100644
@@ -991,7 +991,7 @@ static struct attribute ** __cpuinit amd_l3_attrs(void)
 	if (attrs)
 		return attrs;
 
-	n = sizeof (default_attrs) / sizeof (struct attribute *);
+	n = ARRAY_SIZE(default_attrs);
 
 	if (amd_nb_has_feature(AMD_NB_L3_INDEX_DISABLE))
 		n += 2;
#2 lore raw

[tip:x86/urgent] x86/cache_info: Use ARRAY_SIZE() in amd_l3_attrs( )

In reply to Dan Carpenter
Commit-ID:  961c79761dda351b5fb263a0654b98daac130b7a
Gitweb:     http://git.kernel.org/tip/961c79761dda351b5fb263a0654b98daac130b7a
Author:     Dan Carpenter <[email protected]>
AuthorDate: Tue, 2 Oct 2012 11:34:09 +0300
Committer:  Ingo Molnar <[email protected]>
CommitDate: Thu, 4 Oct 2012 13:28:08 +0200

x86/cache_info: Use ARRAY_SIZE() in amd_l3_attrs()

Using ARRAY_SIZE() is more readable.

---
 arch/x86/kernel/cpu/intel_cacheinfo.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/x86/kernel/cpu/intel_cacheinfo.c +1 -1
index 9a7c90d..93c5451 100644
@@ -991,7 +991,7 @@ static struct attribute ** __cpuinit amd_l3_attrs(void)
 	if (attrs)
 		return attrs;
 
-	n = sizeof (default_attrs) / sizeof (struct attribute *);
+	n = ARRAY_SIZE(default_attrs);
 
 	if (amd_nb_has_feature(AMD_NB_L3_INDEX_DISABLE))
 		n += 2;