aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorDave Jones <davej@redhat.com>2005-10-20 18:16:15 -0400
committerDave Jones <davej@redhat.com>2005-10-20 18:16:15 -0400
commitbfdc708dc7d26fca66df0157b36356a2ba6166eb (patch)
tree600bcb92a1b11ca99d93d65cace469e40346b3c2 /arch
parentb9111b7b7f46b0ec1ccb451d60ec439b92e4df65 (diff)
[CPUFREQ] kzalloc conversions for i386 drivers.
Signed-off-by: Dave Jones <davej@redhat.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c3
-rw-r--r--arch/i386/kernel/cpu/cpufreq/powernow-k7.c12
-rw-r--r--arch/i386/kernel/cpu/cpufreq/powernow-k8.c3
-rw-r--r--arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c3
4 files changed, 6 insertions, 15 deletions
diff --git a/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c b/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c
index 822c8ce9d1f1..22b5622897f0 100644
--- a/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c
+++ b/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c
@@ -376,10 +376,9 @@ acpi_cpufreq_cpu_init (
376 arg0.buffer.length = 12; 376 arg0.buffer.length = 12;
377 arg0.buffer.pointer = (u8 *) arg0_buf; 377 arg0.buffer.pointer = (u8 *) arg0_buf;
378 378
379 data = kmalloc(sizeof(struct cpufreq_acpi_io), GFP_KERNEL); 379 data = kzalloc(sizeof(struct cpufreq_acpi_io), GFP_KERNEL);
380 if (!data) 380 if (!data)
381 return (-ENOMEM); 381 return (-ENOMEM);
382 memset(data, 0, sizeof(struct cpufreq_acpi_io));
383 382
384 acpi_io_data[cpu] = data; 383 acpi_io_data[cpu] = data;
385 384
diff --git a/arch/i386/kernel/cpu/cpufreq/powernow-k7.c b/arch/i386/kernel/cpu/cpufreq/powernow-k7.c
index 73a5dc5b26b8..edcd626001da 100644
--- a/arch/i386/kernel/cpu/cpufreq/powernow-k7.c
+++ b/arch/i386/kernel/cpu/cpufreq/powernow-k7.c
@@ -171,10 +171,9 @@ static int get_ranges (unsigned char *pst)
171 unsigned int speed; 171 unsigned int speed;
172 u8 fid, vid; 172 u8 fid, vid;
173 173
174 powernow_table = kmalloc((sizeof(struct cpufreq_frequency_table) * (number_scales + 1)), GFP_KERNEL); 174 powernow_table = kzalloc((sizeof(struct cpufreq_frequency_table) * (number_scales + 1)), GFP_KERNEL);
175 if (!powernow_table) 175 if (!powernow_table)
176 return -ENOMEM; 176 return -ENOMEM;
177 memset(powernow_table, 0, (sizeof(struct cpufreq_frequency_table) * (number_scales + 1)));
178 177
179 for (j=0 ; j < number_scales; j++) { 178 for (j=0 ; j < number_scales; j++) {
180 fid = *pst++; 179 fid = *pst++;
@@ -305,16 +304,13 @@ static int powernow_acpi_init(void)
305 goto err0; 304 goto err0;
306 } 305 }
307 306
308 acpi_processor_perf = kmalloc(sizeof(struct acpi_processor_performance), 307 acpi_processor_perf = kzalloc(sizeof(struct acpi_processor_performance),
309 GFP_KERNEL); 308 GFP_KERNEL);
310
311 if (!acpi_processor_perf) { 309 if (!acpi_processor_perf) {
312 retval = -ENOMEM; 310 retval = -ENOMEM;
313 goto err0; 311 goto err0;
314 } 312 }
315 313
316 memset(acpi_processor_perf, 0, sizeof(struct acpi_processor_performance));
317
318 if (acpi_processor_register_performance(acpi_processor_perf, 0)) { 314 if (acpi_processor_register_performance(acpi_processor_perf, 0)) {
319 retval = -EIO; 315 retval = -EIO;
320 goto err1; 316 goto err1;
@@ -337,14 +333,12 @@ static int powernow_acpi_init(void)
337 goto err2; 333 goto err2;
338 } 334 }
339 335
340 powernow_table = kmalloc((number_scales + 1) * (sizeof(struct cpufreq_frequency_table)), GFP_KERNEL); 336 powernow_table = kzalloc((number_scales + 1) * (sizeof(struct cpufreq_frequency_table)), GFP_KERNEL);
341 if (!powernow_table) { 337 if (!powernow_table) {
342 retval = -ENOMEM; 338 retval = -ENOMEM;
343 goto err2; 339 goto err2;
344 } 340 }
345 341
346 memset(powernow_table, 0, ((number_scales + 1) * sizeof(struct cpufreq_frequency_table)));
347
348 pc.val = (unsigned long) acpi_processor_perf->states[0].control; 342 pc.val = (unsigned long) acpi_processor_perf->states[0].control;
349 for (i = 0; i < number_scales; i++) { 343 for (i = 0; i < number_scales; i++) {
350 u8 fid, vid; 344 u8 fid, vid;
diff --git a/arch/i386/kernel/cpu/cpufreq/powernow-k8.c b/arch/i386/kernel/cpu/cpufreq/powernow-k8.c
index e2e03eebedf6..beb101157bd9 100644
--- a/arch/i386/kernel/cpu/cpufreq/powernow-k8.c
+++ b/arch/i386/kernel/cpu/cpufreq/powernow-k8.c
@@ -976,12 +976,11 @@ static int __init powernowk8_cpu_init(struct cpufreq_policy *pol)
976 if (!check_supported_cpu(pol->cpu)) 976 if (!check_supported_cpu(pol->cpu))
977 return -ENODEV; 977 return -ENODEV;
978 978
979 data = kmalloc(sizeof(struct powernow_k8_data), GFP_KERNEL); 979 data = kzalloc(sizeof(struct powernow_k8_data), GFP_KERNEL);
980 if (!data) { 980 if (!data) {
981 printk(KERN_ERR PFX "unable to alloc powernow_k8_data"); 981 printk(KERN_ERR PFX "unable to alloc powernow_k8_data");
982 return -ENOMEM; 982 return -ENOMEM;
983 } 983 }
984 memset(data,0,sizeof(struct powernow_k8_data));
985 984
986 data->cpu = pol->cpu; 985 data->cpu = pol->cpu;
987 986
diff --git a/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c b/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c
index c397b6220430..92936c1e173b 100644
--- a/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c
+++ b/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c
@@ -422,12 +422,11 @@ static int centrino_cpu_init_acpi(struct cpufreq_policy *policy)
422 } 422 }
423 } 423 }
424 424
425 centrino_model[cpu] = kmalloc(sizeof(struct cpu_model), GFP_KERNEL); 425 centrino_model[cpu] = kzalloc(sizeof(struct cpu_model), GFP_KERNEL);
426 if (!centrino_model[cpu]) { 426 if (!centrino_model[cpu]) {
427 result = -ENOMEM; 427 result = -ENOMEM;
428 goto err_unreg; 428 goto err_unreg;
429 } 429 }
430 memset(centrino_model[cpu], 0, sizeof(struct cpu_model));
431 430
432 centrino_model[cpu]->model_name=NULL; 431 centrino_model[cpu]->model_name=NULL;
433 centrino_model[cpu]->max_freq = p.states[0].core_frequency * 1000; 432 centrino_model[cpu]->max_freq = p.states[0].core_frequency * 1000;