linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] edac: Fix kcalloc argument order
@ 2013-01-26 19:24 Joe Perches
  2013-01-26 21:24 ` Borislav Petkov
  0 siblings, 1 reply; 2+ messages in thread
From: Joe Perches @ 2013-01-26 19:24 UTC (permalink / raw)
  To: Doug Thompson; +Cc: Linux Edac Mailing List, linux-kernel

First number, then size.

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/edac/edac_mc.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c
index a641f62..fb219bc 100644
--- a/drivers/edac/edac_mc.c
+++ b/drivers/edac/edac_mc.c
@@ -340,7 +340,7 @@ struct mem_ctl_info *edac_mc_alloc(unsigned mc_num,
 	/*
 	 * Alocate and fill the csrow/channels structs
 	 */
-	mci->csrows = kcalloc(sizeof(*mci->csrows), tot_csrows, GFP_KERNEL);
+	mci->csrows = kcalloc(tot_csrows, sizeof(*mci->csrows), GFP_KERNEL);
 	if (!mci->csrows)
 		goto error;
 	for (row = 0; row < tot_csrows; row++) {
@@ -351,7 +351,7 @@ struct mem_ctl_info *edac_mc_alloc(unsigned mc_num,
 		csr->csrow_idx = row;
 		csr->mci = mci;
 		csr->nr_channels = tot_channels;
-		csr->channels = kcalloc(sizeof(*csr->channels), tot_channels,
+		csr->channels = kcalloc(tot_channels, sizeof(*csr->channels),
 					GFP_KERNEL);
 		if (!csr->channels)
 			goto error;
@@ -369,7 +369,7 @@ struct mem_ctl_info *edac_mc_alloc(unsigned mc_num,
 	/*
 	 * Allocate and fill the dimm structs
 	 */
-	mci->dimms  = kcalloc(sizeof(*mci->dimms), tot_dimms, GFP_KERNEL);
+	mci->dimms  = kcalloc(tot_dimms, sizeof(*mci->dimms), GFP_KERNEL);
 	if (!mci->dimms)
 		goto error;
 



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] edac: Fix kcalloc argument order
  2013-01-26 19:24 [PATCH] edac: Fix kcalloc argument order Joe Perches
@ 2013-01-26 21:24 ` Borislav Petkov
  0 siblings, 0 replies; 2+ messages in thread
From: Borislav Petkov @ 2013-01-26 21:24 UTC (permalink / raw)
  To: Joe Perches; +Cc: Doug Thompson, Linux Edac Mailing List, linux-kernel

On Sat, Jan 26, 2013 at 11:24:00AM -0800, Joe Perches wrote:
> First number, then size.
> 
> Signed-off-by: Joe Perches <joe@perches.com>

Applied, thanks.

-- 
Regards/Gruss,
    Boris.

Sent from a fat crate under my desk. Formatting is fine.
--

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-01-26 21:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-26 19:24 [PATCH] edac: Fix kcalloc argument order Joe Perches
2013-01-26 21:24 ` Borislav Petkov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).