OSDN Git Service
(root)
/
android-x86
/
kernel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c9eaa44
)
ARM: 8008/1: topology: Coding style fixes
author
Mark Brown
<broonie@linaro.org>
Thu, 20 Mar 2014 14:16:54 +0000
(15:16 +0100)
committer
Russell King
<rmk+kernel@arm.linux.org.uk>
Mon, 14 Apr 2014 22:27:19 +0000
(23:27 +0100)
Use kcalloc() and ULONG_MAX rather than open coding them.
Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/kernel/topology.c
patch
|
blob
|
history
diff --git
a/arch/arm/kernel/topology.c
b/arch/arm/kernel/topology.c
index
0bc94b1
..
0fa8825
100644
(file)
--- a/
arch/arm/kernel/topology.c
+++ b/
arch/arm/kernel/topology.c
@@
-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;