summaryrefslogtreecommitdiff
path: root/arch/mips/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/kernel')
-rw-r--r--arch/mips/kernel/module.c2
-rw-r--r--arch/mips/kernel/smp-cps.c14
-rw-r--r--arch/mips/kernel/vpe.c6
3 files changed, 10 insertions, 12 deletions
diff --git a/arch/mips/kernel/module.c b/arch/mips/kernel/module.c
index ba0f62d8eff5..9ef50013c818 100644
--- a/arch/mips/kernel/module.c
+++ b/arch/mips/kernel/module.c
@@ -72,7 +72,7 @@ static int apply_r_mips_hi16(struct module *me, u32 *location, Elf_Addr v,
* the carry we need to add. Save the information, and let LO16 do the
* actual relocation.
*/
- n = kmalloc(sizeof *n, GFP_KERNEL);
+ n = kmalloc_obj(*n, GFP_KERNEL);
if (!n)
return -ENOMEM;
diff --git a/arch/mips/kernel/smp-cps.c b/arch/mips/kernel/smp-cps.c
index 22d4f9ff3ae2..ef5dca1313b2 100644
--- a/arch/mips/kernel/smp-cps.c
+++ b/arch/mips/kernel/smp-cps.c
@@ -341,9 +341,8 @@ static void __init cps_prepare_cpus(unsigned int max_cpus)
/* Allocate cluster boot configuration structs */
nclusters = mips_cps_numclusters();
- mips_cps_cluster_bootcfg = kcalloc(nclusters,
- sizeof(*mips_cps_cluster_bootcfg),
- GFP_KERNEL);
+ mips_cps_cluster_bootcfg = kzalloc_objs(*mips_cps_cluster_bootcfg,
+ nclusters, GFP_KERNEL);
if (!mips_cps_cluster_bootcfg)
goto err_out;
@@ -353,8 +352,7 @@ static void __init cps_prepare_cpus(unsigned int max_cpus)
for (cl = 0; cl < nclusters; cl++) {
/* Allocate core boot configuration structs */
ncores = mips_cps_numcores(cl);
- core_bootcfg = kcalloc(ncores, sizeof(*core_bootcfg),
- GFP_KERNEL);
+ core_bootcfg = kzalloc_objs(*core_bootcfg, ncores, GFP_KERNEL);
if (!core_bootcfg)
goto err_out;
mips_cps_cluster_bootcfg[cl].core_config = core_bootcfg;
@@ -369,9 +367,9 @@ static void __init cps_prepare_cpus(unsigned int max_cpus)
for (c = 0; c < ncores; c++) {
int v;
core_vpes = core_vpe_count(cl, c);
- core_bootcfg[c].vpe_config = kcalloc(core_vpes,
- sizeof(*core_bootcfg[c].vpe_config),
- GFP_KERNEL);
+ core_bootcfg[c].vpe_config = kzalloc_objs(*core_bootcfg[c].vpe_config,
+ core_vpes,
+ GFP_KERNEL);
for (v = 0; v < core_vpes; v++)
cpumask_set_cpu(nvpe++, &mips_cps_cluster_bootcfg[cl].cpumask);
if (!core_bootcfg[c].vpe_config)
diff --git a/arch/mips/kernel/vpe.c b/arch/mips/kernel/vpe.c
index 2b67c44adab9..fdbb5c4de834 100644
--- a/arch/mips/kernel/vpe.c
+++ b/arch/mips/kernel/vpe.c
@@ -94,7 +94,7 @@ struct vpe *alloc_vpe(int minor)
{
struct vpe *v;
- v = kzalloc(sizeof(struct vpe), GFP_KERNEL);
+ v = kzalloc_obj(struct vpe, GFP_KERNEL);
if (v == NULL)
goto out;
@@ -115,7 +115,7 @@ struct tc *alloc_tc(int index)
{
struct tc *tc;
- tc = kzalloc(sizeof(struct tc), GFP_KERNEL);
+ tc = kzalloc_obj(struct tc, GFP_KERNEL);
if (tc == NULL)
goto out;
@@ -318,7 +318,7 @@ static int apply_r_mips_hi16(struct module *me, uint32_t *location,
* the carry we need to add. Save the information, and let LO16 do the
* actual relocation.
*/
- n = kmalloc(sizeof(*n), GFP_KERNEL);
+ n = kmalloc_obj(*n, GFP_KERNEL);
if (!n)
return -ENOMEM;