lkml.org 
[lkml]   [2012]   [Apr]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [EDAC ABI v13 24/25] edac: change the mem allocation scheme to make Documentation/kobject.txt happy
From
Date
On Thu, 2012-04-19 at 10:14 -0300, Mauro Carvalho Chehab wrote:
> diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c
[]
> @@ -296,7 +296,7 @@ struct mem_ctl_info *edac_mc_alloc(unsigned edac_index,
> /*
> * Alocate and fill the csrow/channels structs
> */
> - mci->csrows = kzalloc(sizeof(*mci->csrows) * tot_csrows, GFP_KERNEL);
> + mci->csrows = kcalloc(sizeof(*mci->csrows), tot_csrows, GFP_KERNEL);

trivia: the first 2 args to kcalloc should be swapped.

static inline void *kcalloc(size_t n, size_t size, gfp_t flags)

kcalloc(tot_csrows, sizeof(*mci->csrows), GFP_KERNEL);
[]
> @@ -307,7 +307,7 @@ struct mem_ctl_info *edac_mc_alloc(unsigned edac_index,
> csr->csrow_idx = row;
> csr->mci = mci;
> csr->nr_channels = tot_cschannels;
> - csr->channels = kzalloc(sizeof(*csr->channels) * tot_cschannels,
> + csr->channels = kcalloc(sizeof(*csr->channels), tot_cschannels,

and here.

[]
> @@ -323,7 +323,7 @@ struct mem_ctl_info *edac_mc_alloc(unsigned edac_index,
> /*
> * Allocate and fill the dimm structs
> */
> - mci->dimms = kzalloc(sizeof(*mci->dimms) * tot_dimms, GFP_KERNEL);
> + mci->dimms = kcalloc(sizeof(*mci->dimms), tot_dimms, GFP_KERNEL);

and here too.




\
 
 \ /
  Last update: 2012-04-24 20:13    [W:0.108 / U:1.040 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site