* [PATCH] regmap: Fix kcalloc parameters swapped
@ 2012-02-10 11:29 Axel Lin
2012-02-10 11:47 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Axel Lin @ 2012-02-10 11:29 UTC (permalink / raw)
To: linux-kernel; +Cc: Mark Brown
The first parameter should be "number of elements" and the second parameter
should be "element size".
Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
drivers/base/regmap/regmap.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c
index f9cdaf3..11d54e7 100644
--- a/drivers/base/regmap/regmap.c
+++ b/drivers/base/regmap/regmap.c
@@ -785,7 +785,7 @@ int regmap_register_patch(struct regmap *map, const struct reg_default *regs,
}
}
- map->patch = kcalloc(sizeof(struct reg_default), num_regs, GFP_KERNEL);
+ map->patch = kcalloc(num_regs, sizeof(struct reg_default), GFP_KERNEL);
if (map->patch != NULL) {
memcpy(map->patch, regs,
num_regs * sizeof(struct reg_default));
--
1.7.5.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] regmap: Fix kcalloc parameters swapped
2012-02-10 11:29 [PATCH] regmap: Fix kcalloc parameters swapped Axel Lin
@ 2012-02-10 11:47 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2012-02-10 11:47 UTC (permalink / raw)
To: Axel Lin; +Cc: linux-kernel
[-- Attachment #1: Type: text/plain, Size: 288 bytes --]
On Fri, Feb 10, 2012 at 07:29:55PM +0800, Axel Lin wrote:
> The first parameter should be "number of elements" and the second parameter
> should be "element size".
Applied, thanks. Not that it makes any practical difference given that
the function will just multiply the two numbers...
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-02-10 11:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-10 11:29 [PATCH] regmap: Fix kcalloc parameters swapped Axel Lin
2012-02-10 11:47 ` Mark Brown
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).