diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/cpufreq/acpi-cpufreq.c | 4 | ||||
-rw-r--r-- | drivers/cpufreq/cpufreq.c | 9 | ||||
-rw-r--r-- | drivers/cpufreq/cpufreq_conservative.c | 2 | ||||
-rw-r--r-- | drivers/cpufreq/cpufreq_ondemand.c | 2 | ||||
-rw-r--r-- | drivers/cpufreq/cpufreq_stats.c | 2 | ||||
-rw-r--r-- | drivers/cpufreq/e_powersaver.c | 4 | ||||
-rw-r--r-- | drivers/cpufreq/exynos-cpufreq.c | 2 | ||||
-rw-r--r-- | drivers/cpufreq/gx-suspmod.c | 2 | ||||
-rw-r--r-- | drivers/cpufreq/ia64-acpi-cpufreq.c | 4 | ||||
-rw-r--r-- | drivers/cpufreq/pmac64-cpufreq.c | 5 | ||||
-rw-r--r-- | drivers/cpufreq/powernow-k7.c | 13 | ||||
-rw-r--r-- | drivers/cpufreq/powernow-k8.c | 6 | ||||
-rw-r--r-- | drivers/cpufreq/s3c24xx-cpufreq.c | 6 | ||||
-rw-r--r-- | drivers/cpufreq/sparc-us2e-cpufreq.c | 5 | ||||
-rw-r--r-- | drivers/cpufreq/sparc-us3-cpufreq.c | 5 |
15 files changed, 33 insertions, 38 deletions
diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c index e673670d2321..44758ce9936d 100644 --- a/drivers/cpufreq/acpi-cpufreq.c +++ b/drivers/cpufreq/acpi-cpufreq.c | |||
@@ -709,7 +709,7 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy) | |||
709 | return blacklisted; | 709 | return blacklisted; |
710 | #endif | 710 | #endif |
711 | 711 | ||
712 | data = kzalloc(sizeof(struct acpi_cpufreq_data), GFP_KERNEL); | 712 | data = kzalloc(sizeof(*data), GFP_KERNEL); |
713 | if (!data) | 713 | if (!data) |
714 | return -ENOMEM; | 714 | return -ENOMEM; |
715 | 715 | ||
@@ -799,7 +799,7 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy) | |||
799 | goto err_unreg; | 799 | goto err_unreg; |
800 | } | 800 | } |
801 | 801 | ||
802 | data->freq_table = kmalloc(sizeof(struct cpufreq_frequency_table) * | 802 | data->freq_table = kmalloc(sizeof(*data->freq_table) * |
803 | (perf->state_count+1), GFP_KERNEL); | 803 | (perf->state_count+1), GFP_KERNEL); |
804 | if (!data->freq_table) { | 804 | if (!data->freq_table) { |
805 | result = -ENOMEM; | 805 | result = -ENOMEM; |
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 1793fe82595d..9e83d9142072 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c | |||
@@ -873,7 +873,7 @@ static void cpufreq_init_policy(struct cpufreq_policy *policy) | |||
873 | struct cpufreq_policy new_policy; | 873 | struct cpufreq_policy new_policy; |
874 | int ret = 0; | 874 | int ret = 0; |
875 | 875 | ||
876 | memcpy(&new_policy, policy, sizeof(struct cpufreq_policy)); | 876 | memcpy(&new_policy, policy, sizeof(*policy)); |
877 | /* assure that the starting sequence is run in __cpufreq_set_policy */ | 877 | /* assure that the starting sequence is run in __cpufreq_set_policy */ |
878 | policy->governor = NULL; | 878 | policy->governor = NULL; |
879 | 879 | ||
@@ -1818,7 +1818,7 @@ int cpufreq_get_policy(struct cpufreq_policy *policy, unsigned int cpu) | |||
1818 | if (!cpu_policy) | 1818 | if (!cpu_policy) |
1819 | return -EINVAL; | 1819 | return -EINVAL; |
1820 | 1820 | ||
1821 | memcpy(policy, cpu_policy, sizeof(struct cpufreq_policy)); | 1821 | memcpy(policy, cpu_policy, sizeof(*policy)); |
1822 | 1822 | ||
1823 | cpufreq_cpu_put(cpu_policy); | 1823 | cpufreq_cpu_put(cpu_policy); |
1824 | return 0; | 1824 | return 0; |
@@ -1837,8 +1837,7 @@ static int __cpufreq_set_policy(struct cpufreq_policy *policy, | |||
1837 | pr_debug("setting new policy for CPU %u: %u - %u kHz\n", new_policy->cpu, | 1837 | pr_debug("setting new policy for CPU %u: %u - %u kHz\n", new_policy->cpu, |
1838 | new_policy->min, new_policy->max); | 1838 | new_policy->min, new_policy->max); |
1839 | 1839 | ||
1840 | memcpy(&new_policy->cpuinfo, &policy->cpuinfo, | 1840 | memcpy(&new_policy->cpuinfo, &policy->cpuinfo, sizeof(policy->cpuinfo)); |
1841 | sizeof(struct cpufreq_cpuinfo)); | ||
1842 | 1841 | ||
1843 | if (new_policy->min > policy->max || new_policy->max < policy->min) { | 1842 | if (new_policy->min > policy->max || new_policy->max < policy->min) { |
1844 | ret = -EINVAL; | 1843 | ret = -EINVAL; |
@@ -1957,7 +1956,7 @@ int cpufreq_update_policy(unsigned int cpu) | |||
1957 | } | 1956 | } |
1958 | 1957 | ||
1959 | pr_debug("updating policy for CPU %u\n", cpu); | 1958 | pr_debug("updating policy for CPU %u\n", cpu); |
1960 | memcpy(&new_policy, policy, sizeof(struct cpufreq_policy)); | 1959 | memcpy(&new_policy, policy, sizeof(*policy)); |
1961 | new_policy.min = policy->user_policy.min; | 1960 | new_policy.min = policy->user_policy.min; |
1962 | new_policy.max = policy->user_policy.max; | 1961 | new_policy.max = policy->user_policy.max; |
1963 | new_policy.policy = policy->user_policy.policy; | 1962 | new_policy.policy = policy->user_policy.policy; |
diff --git a/drivers/cpufreq/cpufreq_conservative.c b/drivers/cpufreq/cpufreq_conservative.c index 841e25699656..c4009241e733 100644 --- a/drivers/cpufreq/cpufreq_conservative.c +++ b/drivers/cpufreq/cpufreq_conservative.c | |||
@@ -317,7 +317,7 @@ static int cs_init(struct dbs_data *dbs_data) | |||
317 | { | 317 | { |
318 | struct cs_dbs_tuners *tuners; | 318 | struct cs_dbs_tuners *tuners; |
319 | 319 | ||
320 | tuners = kzalloc(sizeof(struct cs_dbs_tuners), GFP_KERNEL); | 320 | tuners = kzalloc(sizeof(*tuners), GFP_KERNEL); |
321 | if (!tuners) { | 321 | if (!tuners) { |
322 | pr_err("%s: kzalloc failed\n", __func__); | 322 | pr_err("%s: kzalloc failed\n", __func__); |
323 | return -ENOMEM; | 323 | return -ENOMEM; |
diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c index 47d4b69be7c6..117278ab5869 100644 --- a/drivers/cpufreq/cpufreq_ondemand.c +++ b/drivers/cpufreq/cpufreq_ondemand.c | |||
@@ -482,7 +482,7 @@ static int od_init(struct dbs_data *dbs_data) | |||
482 | u64 idle_time; | 482 | u64 idle_time; |
483 | int cpu; | 483 | int cpu; |
484 | 484 | ||
485 | tuners = kzalloc(sizeof(struct od_dbs_tuners), GFP_KERNEL); | 485 | tuners = kzalloc(sizeof(*tuners), GFP_KERNEL); |
486 | if (!tuners) { | 486 | if (!tuners) { |
487 | pr_err("%s: kzalloc failed\n", __func__); | 487 | pr_err("%s: kzalloc failed\n", __func__); |
488 | return -ENOMEM; | 488 | return -ENOMEM; |
diff --git a/drivers/cpufreq/cpufreq_stats.c b/drivers/cpufreq/cpufreq_stats.c index a17b14ee37d8..04452f026ed0 100644 --- a/drivers/cpufreq/cpufreq_stats.c +++ b/drivers/cpufreq/cpufreq_stats.c | |||
@@ -198,7 +198,7 @@ static int cpufreq_stats_create_table(struct cpufreq_policy *policy, | |||
198 | unsigned int cpu = policy->cpu; | 198 | unsigned int cpu = policy->cpu; |
199 | if (per_cpu(cpufreq_stats_table, cpu)) | 199 | if (per_cpu(cpufreq_stats_table, cpu)) |
200 | return -EBUSY; | 200 | return -EBUSY; |
201 | stat = kzalloc(sizeof(struct cpufreq_stats), GFP_KERNEL); | 201 | stat = kzalloc(sizeof(*stat), GFP_KERNEL); |
202 | if ((stat) == NULL) | 202 | if ((stat) == NULL) |
203 | return -ENOMEM; | 203 | return -ENOMEM; |
204 | 204 | ||
diff --git a/drivers/cpufreq/e_powersaver.c b/drivers/cpufreq/e_powersaver.c index a60efaeb4cf8..de974be6b773 100644 --- a/drivers/cpufreq/e_powersaver.c +++ b/drivers/cpufreq/e_powersaver.c | |||
@@ -54,7 +54,7 @@ static struct acpi_processor_performance *eps_acpi_cpu_perf; | |||
54 | /* Minimum necessary to get acpi_processor_get_bios_limit() working */ | 54 | /* Minimum necessary to get acpi_processor_get_bios_limit() working */ |
55 | static int eps_acpi_init(void) | 55 | static int eps_acpi_init(void) |
56 | { | 56 | { |
57 | eps_acpi_cpu_perf = kzalloc(sizeof(struct acpi_processor_performance), | 57 | eps_acpi_cpu_perf = kzalloc(sizeof(*eps_acpi_cpu_perf), |
58 | GFP_KERNEL); | 58 | GFP_KERNEL); |
59 | if (!eps_acpi_cpu_perf) | 59 | if (!eps_acpi_cpu_perf) |
60 | return -ENOMEM; | 60 | return -ENOMEM; |
@@ -366,7 +366,7 @@ static int eps_cpu_init(struct cpufreq_policy *policy) | |||
366 | states = 2; | 366 | states = 2; |
367 | 367 | ||
368 | /* Allocate private data and frequency table for current cpu */ | 368 | /* Allocate private data and frequency table for current cpu */ |
369 | centaur = kzalloc(sizeof(struct eps_cpu_data) | 369 | centaur = kzalloc(sizeof(*centaur) |
370 | + (states + 1) * sizeof(struct cpufreq_frequency_table), | 370 | + (states + 1) * sizeof(struct cpufreq_frequency_table), |
371 | GFP_KERNEL); | 371 | GFP_KERNEL); |
372 | if (!centaur) | 372 | if (!centaur) |
diff --git a/drivers/cpufreq/exynos-cpufreq.c b/drivers/cpufreq/exynos-cpufreq.c index 0d32f02ef4d6..366475161c76 100644 --- a/drivers/cpufreq/exynos-cpufreq.c +++ b/drivers/cpufreq/exynos-cpufreq.c | |||
@@ -289,7 +289,7 @@ static int __init exynos_cpufreq_init(void) | |||
289 | { | 289 | { |
290 | int ret = -EINVAL; | 290 | int ret = -EINVAL; |
291 | 291 | ||
292 | exynos_info = kzalloc(sizeof(struct exynos_dvfs_info), GFP_KERNEL); | 292 | exynos_info = kzalloc(sizeof(*exynos_info), GFP_KERNEL); |
293 | if (!exynos_info) | 293 | if (!exynos_info) |
294 | return -ENOMEM; | 294 | return -ENOMEM; |
295 | 295 | ||
diff --git a/drivers/cpufreq/gx-suspmod.c b/drivers/cpufreq/gx-suspmod.c index 3dfc99b9ca86..4f25fb63c097 100644 --- a/drivers/cpufreq/gx-suspmod.c +++ b/drivers/cpufreq/gx-suspmod.c | |||
@@ -466,7 +466,7 @@ static int __init cpufreq_gx_init(void) | |||
466 | 466 | ||
467 | pr_debug("geode suspend modulation available.\n"); | 467 | pr_debug("geode suspend modulation available.\n"); |
468 | 468 | ||
469 | params = kzalloc(sizeof(struct gxfreq_params), GFP_KERNEL); | 469 | params = kzalloc(sizeof(*params), GFP_KERNEL); |
470 | if (params == NULL) | 470 | if (params == NULL) |
471 | return -ENOMEM; | 471 | return -ENOMEM; |
472 | 472 | ||
diff --git a/drivers/cpufreq/ia64-acpi-cpufreq.c b/drivers/cpufreq/ia64-acpi-cpufreq.c index 573c14ea802d..08792dd4d62a 100644 --- a/drivers/cpufreq/ia64-acpi-cpufreq.c +++ b/drivers/cpufreq/ia64-acpi-cpufreq.c | |||
@@ -274,7 +274,7 @@ acpi_cpufreq_cpu_init ( | |||
274 | 274 | ||
275 | pr_debug("acpi_cpufreq_cpu_init\n"); | 275 | pr_debug("acpi_cpufreq_cpu_init\n"); |
276 | 276 | ||
277 | data = kzalloc(sizeof(struct cpufreq_acpi_io), GFP_KERNEL); | 277 | data = kzalloc(sizeof(*data), GFP_KERNEL); |
278 | if (!data) | 278 | if (!data) |
279 | return (-ENOMEM); | 279 | return (-ENOMEM); |
280 | 280 | ||
@@ -304,7 +304,7 @@ acpi_cpufreq_cpu_init ( | |||
304 | } | 304 | } |
305 | 305 | ||
306 | /* alloc freq_table */ | 306 | /* alloc freq_table */ |
307 | data->freq_table = kmalloc(sizeof(struct cpufreq_frequency_table) * | 307 | data->freq_table = kmalloc(sizeof(*data->freq_table) * |
308 | (data->acpi_data.state_count + 1), | 308 | (data->acpi_data.state_count + 1), |
309 | GFP_KERNEL); | 309 | GFP_KERNEL); |
310 | if (!data->freq_table) { | 310 | if (!data->freq_table) { |
diff --git a/drivers/cpufreq/pmac64-cpufreq.c b/drivers/cpufreq/pmac64-cpufreq.c index 7ba423431cfe..4d7799b7af86 100644 --- a/drivers/cpufreq/pmac64-cpufreq.c +++ b/drivers/cpufreq/pmac64-cpufreq.c | |||
@@ -447,9 +447,8 @@ static int __init g5_neo2_cpufreq_init(struct device_node *cpus) | |||
447 | if (!shdr) | 447 | if (!shdr) |
448 | goto bail_noprops; | 448 | goto bail_noprops; |
449 | g5_fvt_table = (struct smu_sdbp_fvt *)&shdr[1]; | 449 | g5_fvt_table = (struct smu_sdbp_fvt *)&shdr[1]; |
450 | ssize = (shdr->len * sizeof(u32)) - | 450 | ssize = (shdr->len * sizeof(u32)) - sizeof(*shdr); |
451 | sizeof(struct smu_sdbp_header); | 451 | g5_fvt_count = ssize / sizeof(*g5_fvt_table); |
452 | g5_fvt_count = ssize / sizeof(struct smu_sdbp_fvt); | ||
453 | g5_fvt_cur = 0; | 452 | g5_fvt_cur = 0; |
454 | 453 | ||
455 | /* Sanity checking */ | 454 | /* Sanity checking */ |
diff --git a/drivers/cpufreq/powernow-k7.c b/drivers/cpufreq/powernow-k7.c index 955870877935..4687d40d0219 100644 --- a/drivers/cpufreq/powernow-k7.c +++ b/drivers/cpufreq/powernow-k7.c | |||
@@ -177,7 +177,7 @@ static int get_ranges(unsigned char *pst) | |||
177 | unsigned int speed; | 177 | unsigned int speed; |
178 | u8 fid, vid; | 178 | u8 fid, vid; |
179 | 179 | ||
180 | powernow_table = kzalloc((sizeof(struct cpufreq_frequency_table) * | 180 | powernow_table = kzalloc((sizeof(*powernow_table) * |
181 | (number_scales + 1)), GFP_KERNEL); | 181 | (number_scales + 1)), GFP_KERNEL); |
182 | if (!powernow_table) | 182 | if (!powernow_table) |
183 | return -ENOMEM; | 183 | return -ENOMEM; |
@@ -309,8 +309,7 @@ static int powernow_acpi_init(void) | |||
309 | goto err0; | 309 | goto err0; |
310 | } | 310 | } |
311 | 311 | ||
312 | acpi_processor_perf = kzalloc(sizeof(struct acpi_processor_performance), | 312 | acpi_processor_perf = kzalloc(sizeof(*acpi_processor_perf), GFP_KERNEL); |
313 | GFP_KERNEL); | ||
314 | if (!acpi_processor_perf) { | 313 | if (!acpi_processor_perf) { |
315 | retval = -ENOMEM; | 314 | retval = -ENOMEM; |
316 | goto err0; | 315 | goto err0; |
@@ -346,7 +345,7 @@ static int powernow_acpi_init(void) | |||
346 | goto err2; | 345 | goto err2; |
347 | } | 346 | } |
348 | 347 | ||
349 | powernow_table = kzalloc((sizeof(struct cpufreq_frequency_table) * | 348 | powernow_table = kzalloc((sizeof(*powernow_table) * |
350 | (number_scales + 1)), GFP_KERNEL); | 349 | (number_scales + 1)), GFP_KERNEL); |
351 | if (!powernow_table) { | 350 | if (!powernow_table) { |
352 | retval = -ENOMEM; | 351 | retval = -ENOMEM; |
@@ -497,7 +496,7 @@ static int powernow_decode_bios(int maxfid, int startvid) | |||
497 | "relevant to this CPU).\n", | 496 | "relevant to this CPU).\n", |
498 | psb->numpst); | 497 | psb->numpst); |
499 | 498 | ||
500 | p += sizeof(struct psb_s); | 499 | p += sizeof(*psb); |
501 | 500 | ||
502 | pst = (struct pst_s *) p; | 501 | pst = (struct pst_s *) p; |
503 | 502 | ||
@@ -510,12 +509,12 @@ static int powernow_decode_bios(int maxfid, int startvid) | |||
510 | (maxfid == pst->maxfid) && | 509 | (maxfid == pst->maxfid) && |
511 | (startvid == pst->startvid)) { | 510 | (startvid == pst->startvid)) { |
512 | print_pst_entry(pst, j); | 511 | print_pst_entry(pst, j); |
513 | p = (char *)pst + sizeof(struct pst_s); | 512 | p = (char *)pst + sizeof(*pst); |
514 | ret = get_ranges(p); | 513 | ret = get_ranges(p); |
515 | return ret; | 514 | return ret; |
516 | } else { | 515 | } else { |
517 | unsigned int k; | 516 | unsigned int k; |
518 | p = (char *)pst + sizeof(struct pst_s); | 517 | p = (char *)pst + sizeof(*pst); |
519 | for (k = 0; k < number_scales; k++) | 518 | for (k = 0; k < number_scales; k++) |
520 | p += 2; | 519 | p += 2; |
521 | } | 520 | } |
diff --git a/drivers/cpufreq/powernow-k8.c b/drivers/cpufreq/powernow-k8.c index c39d189217cb..3f3c6cae91d0 100644 --- a/drivers/cpufreq/powernow-k8.c +++ b/drivers/cpufreq/powernow-k8.c | |||
@@ -623,7 +623,7 @@ static int fill_powernow_table(struct powernow_k8_data *data, | |||
623 | if (check_pst_table(data, pst, maxvid)) | 623 | if (check_pst_table(data, pst, maxvid)) |
624 | return -EINVAL; | 624 | return -EINVAL; |
625 | 625 | ||
626 | powernow_table = kmalloc((sizeof(struct cpufreq_frequency_table) | 626 | powernow_table = kmalloc((sizeof(*powernow_table) |
627 | * (data->numps + 1)), GFP_KERNEL); | 627 | * (data->numps + 1)), GFP_KERNEL); |
628 | if (!powernow_table) { | 628 | if (!powernow_table) { |
629 | printk(KERN_ERR PFX "powernow_table memory alloc failure\n"); | 629 | printk(KERN_ERR PFX "powernow_table memory alloc failure\n"); |
@@ -793,7 +793,7 @@ static int powernow_k8_cpu_init_acpi(struct powernow_k8_data *data) | |||
793 | } | 793 | } |
794 | 794 | ||
795 | /* fill in data->powernow_table */ | 795 | /* fill in data->powernow_table */ |
796 | powernow_table = kmalloc((sizeof(struct cpufreq_frequency_table) | 796 | powernow_table = kmalloc((sizeof(*powernow_table) |
797 | * (data->acpi_data.state_count + 1)), GFP_KERNEL); | 797 | * (data->acpi_data.state_count + 1)), GFP_KERNEL); |
798 | if (!powernow_table) { | 798 | if (!powernow_table) { |
799 | pr_debug("powernow_table memory alloc failure\n"); | 799 | pr_debug("powernow_table memory alloc failure\n"); |
@@ -1106,7 +1106,7 @@ static int powernowk8_cpu_init(struct cpufreq_policy *pol) | |||
1106 | if (rc) | 1106 | if (rc) |
1107 | return -ENODEV; | 1107 | return -ENODEV; |
1108 | 1108 | ||
1109 | data = kzalloc(sizeof(struct powernow_k8_data), GFP_KERNEL); | 1109 | data = kzalloc(sizeof(*data), GFP_KERNEL); |
1110 | if (!data) { | 1110 | if (!data) { |
1111 | printk(KERN_ERR PFX "unable to alloc powernow_k8_data"); | 1111 | printk(KERN_ERR PFX "unable to alloc powernow_k8_data"); |
1112 | return -ENOMEM; | 1112 | return -ENOMEM; |
diff --git a/drivers/cpufreq/s3c24xx-cpufreq.c b/drivers/cpufreq/s3c24xx-cpufreq.c index 87781eb20d6d..f169ee52e6eb 100644 --- a/drivers/cpufreq/s3c24xx-cpufreq.c +++ b/drivers/cpufreq/s3c24xx-cpufreq.c | |||
@@ -522,7 +522,7 @@ int __init s3c_cpufreq_setboard(struct s3c_cpufreq_board *board) | |||
522 | /* Copy the board information so that each board can make this | 522 | /* Copy the board information so that each board can make this |
523 | * initdata. */ | 523 | * initdata. */ |
524 | 524 | ||
525 | ours = kzalloc(sizeof(struct s3c_cpufreq_board), GFP_KERNEL); | 525 | ours = kzalloc(sizeof(*ours), GFP_KERNEL); |
526 | if (ours == NULL) { | 526 | if (ours == NULL) { |
527 | printk(KERN_ERR "%s: no memory\n", __func__); | 527 | printk(KERN_ERR "%s: no memory\n", __func__); |
528 | return -ENOMEM; | 528 | return -ENOMEM; |
@@ -615,7 +615,7 @@ static int s3c_cpufreq_build_freq(void) | |||
615 | size = cpu_cur.info->calc_freqtable(&cpu_cur, NULL, 0); | 615 | size = cpu_cur.info->calc_freqtable(&cpu_cur, NULL, 0); |
616 | size++; | 616 | size++; |
617 | 617 | ||
618 | ftab = kmalloc(sizeof(struct cpufreq_frequency_table) * size, GFP_KERNEL); | 618 | ftab = kmalloc(sizeof(*ftab) * size, GFP_KERNEL); |
619 | if (!ftab) { | 619 | if (!ftab) { |
620 | printk(KERN_ERR "%s: no memory for tables\n", __func__); | 620 | printk(KERN_ERR "%s: no memory for tables\n", __func__); |
621 | return -ENOMEM; | 621 | return -ENOMEM; |
@@ -691,7 +691,7 @@ int __init s3c_plltab_register(struct cpufreq_frequency_table *plls, | |||
691 | struct cpufreq_frequency_table *vals; | 691 | struct cpufreq_frequency_table *vals; |
692 | unsigned int size; | 692 | unsigned int size; |
693 | 693 | ||
694 | size = sizeof(struct cpufreq_frequency_table) * (plls_no + 1); | 694 | size = sizeof(*vals) * (plls_no + 1); |
695 | 695 | ||
696 | vals = kmalloc(size, GFP_KERNEL); | 696 | vals = kmalloc(size, GFP_KERNEL); |
697 | if (vals) { | 697 | if (vals) { |
diff --git a/drivers/cpufreq/sparc-us2e-cpufreq.c b/drivers/cpufreq/sparc-us2e-cpufreq.c index 93061a408773..7c43a725e5da 100644 --- a/drivers/cpufreq/sparc-us2e-cpufreq.c +++ b/drivers/cpufreq/sparc-us2e-cpufreq.c | |||
@@ -351,12 +351,11 @@ static int __init us2e_freq_init(void) | |||
351 | struct cpufreq_driver *driver; | 351 | struct cpufreq_driver *driver; |
352 | 352 | ||
353 | ret = -ENOMEM; | 353 | ret = -ENOMEM; |
354 | driver = kzalloc(sizeof(struct cpufreq_driver), GFP_KERNEL); | 354 | driver = kzalloc(sizeof(*driver), GFP_KERNEL); |
355 | if (!driver) | 355 | if (!driver) |
356 | goto err_out; | 356 | goto err_out; |
357 | 357 | ||
358 | us2e_freq_table = kzalloc( | 358 | us2e_freq_table = kzalloc((NR_CPUS * sizeof(*us2e_freq_table)), |
359 | (NR_CPUS * sizeof(struct us2e_freq_percpu_info)), | ||
360 | GFP_KERNEL); | 359 | GFP_KERNEL); |
361 | if (!us2e_freq_table) | 360 | if (!us2e_freq_table) |
362 | goto err_out; | 361 | goto err_out; |
diff --git a/drivers/cpufreq/sparc-us3-cpufreq.c b/drivers/cpufreq/sparc-us3-cpufreq.c index 880ee293d61e..7f500c140bc3 100644 --- a/drivers/cpufreq/sparc-us3-cpufreq.c +++ b/drivers/cpufreq/sparc-us3-cpufreq.c | |||
@@ -212,12 +212,11 @@ static int __init us3_freq_init(void) | |||
212 | struct cpufreq_driver *driver; | 212 | struct cpufreq_driver *driver; |
213 | 213 | ||
214 | ret = -ENOMEM; | 214 | ret = -ENOMEM; |
215 | driver = kzalloc(sizeof(struct cpufreq_driver), GFP_KERNEL); | 215 | driver = kzalloc(sizeof(*driver), GFP_KERNEL); |
216 | if (!driver) | 216 | if (!driver) |
217 | goto err_out; | 217 | goto err_out; |
218 | 218 | ||
219 | us3_freq_table = kzalloc( | 219 | us3_freq_table = kzalloc((NR_CPUS * sizeof(*us3_freq_table)), |
220 | (NR_CPUS * sizeof(struct us3_freq_percpu_info)), | ||
221 | GFP_KERNEL); | 220 | GFP_KERNEL); |
222 | if (!us3_freq_table) | 221 | if (!us3_freq_table) |
223 | goto err_out; | 222 | goto err_out; |