projects
/
platform
/
kernel
/
linux-starfive.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
49cd1eb
)
spi: Replace memset() with __GFP_ZERO
author
Andy Shevchenko
<andriy.shevchenko@linux.intel.com>
Mon, 22 Nov 2021 17:17:20 +0000
(19:17 +0200)
committer
Mark Brown
<broonie@kernel.org>
Tue, 23 Nov 2021 12:09:07 +0000
(12:09 +0000)
krealloc() as any other kernel memory allocation calls accepts GFP flags,
one of which is __GFP_ZERO. Hence, no need to call memset() explicitly on
the reallocated buffer.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link:
https://lore.kernel.org/r/20211122171721.61553-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi.c
patch
|
blob
|
history
diff --git
a/drivers/spi/spi.c
b/drivers/spi/spi.c
index 9d19d9bae253765d62ca4686268178d538ea38cc..3b9010a67397594ebca55a36918bda67ef8ae0ba 100644
(file)
--- a/
drivers/spi/spi.c
+++ b/
drivers/spi/spi.c
@@
-1222,11
+1222,10
@@
static int spi_map_msg(struct spi_controller *ctlr, struct spi_message *msg)
if (max_tx) {
tmp = krealloc(ctlr->dummy_tx, max_tx,
- GFP_KERNEL | GFP_DMA);
+ GFP_KERNEL | GFP_DMA
| __GFP_ZERO
);
if (!tmp)
return -ENOMEM;
ctlr->dummy_tx = tmp;
- memset(tmp, 0, max_tx);
}
if (max_rx) {