projects
/
platform
/
kernel
/
linux-rpi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c0a4191
)
swiotlb: simplify array allocation
author
Robin Murphy
<robin.murphy@arm.com>
Mon, 24 Jan 2022 16:40:19 +0000
(16:40 +0000)
committer
Christoph Hellwig
<hch@lst.de>
Wed, 26 Jan 2022 16:21:19 +0000
(17:21 +0100)
Prefer kcalloc() to kzalloc(array_size()) for allocating an array.
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
kernel/dma/swiotlb.c
patch
|
blob
|
history
diff --git
a/kernel/dma/swiotlb.c
b/kernel/dma/swiotlb.c
index
f3ff0af
..
908eac2
100644
(file)
--- a/
kernel/dma/swiotlb.c
+++ b/
kernel/dma/swiotlb.c
@@
-818,8
+818,7
@@
static int rmem_swiotlb_device_init(struct reserved_mem *rmem,
if (!mem)
return -ENOMEM;
- mem->slots = kzalloc(array_size(sizeof(*mem->slots), nslabs),
- GFP_KERNEL);
+ mem->slots = kcalloc(nslabs, sizeof(*mem->slots), GFP_KERNEL);
if (!mem->slots) {
kfree(mem);
return -ENOMEM;