Skip to contentSkip to conversation

ARM: topology: Coding style fixes

PATCH New Mark Brown 1 participant 1 message Jan 7, 2014 Arm (32-bit)

lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH 1/1 ARM: topology: Coding style fixes

From: Mark Brown <[email protected]>

Use kcalloc() and ULONG_MAX rather than open coding them.

---
 arch/arm/kernel/topology.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm/kernel/topology.c +4 -4
index 0bc94b1fd1ae..0fa8825cea04 100644
@@ -91,13 +91,13 @@ static void __init parse_dt_topology(void)
 {
 	const struct cpu_efficiency *cpu_eff;
 	struct device_node *cn = NULL;
-	unsigned long min_capacity = (unsigned long)(-1);
+	unsigned long min_capacity = ULONG_MAX;
 	unsigned long max_capacity = 0;
 	unsigned long capacity = 0;
-	int alloc_size, cpu = 0;
+	int cpu = 0;
 
-	alloc_size = nr_cpu_ids * sizeof(*__cpu_capacity);
-	__cpu_capacity = kzalloc(alloc_size, GFP_NOWAIT);
+	__cpu_capacity = kcalloc(nr_cpu_ids, sizeof(*__cpu_capacity),
+				 GFP_NOWAIT);
 
 	for_each_possible_cpu(cpu) {
 		const u32 *rate;
Signature · 1 line
1.8.5.2