diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2021-11-22 18:17:20 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2021-11-23 13:09:07 +0100 |
commit | b00bab9d48bbb6446a5cf366f5f8e501a16031a1 (patch) | |
tree | 7380ef93c5444e41b63ef3ce26986d5f6a120960 | |
parent | spi: fsl-lpspi: Add imx8ulp compatible string (diff) | |
download | linux-b00bab9d48bbb6446a5cf366f5f8e501a16031a1.tar.xz linux-b00bab9d48bbb6446a5cf366f5f8e501a16031a1.zip |
spi: Replace memset() with __GFP_ZERO
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>
-rw-r--r-- | drivers/spi/spi.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index 9d19d9bae253..3b9010a67397 100644 --- 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) { |