summaryrefslogtreecommitdiff
path: root/drivers/spi
diff options
context:
space:
mode:
authorKuan-Wei Chiu <visitorckw@gmail.com>2024-08-15 03:28:39 +0800
committerMark Brown <broonie@kernel.org>2024-09-02 19:17:44 +0100
commitf626a0cd07ddb13f146e52adb4b534da40bb1ff7 (patch)
tree4f1f78ea6daf21f65318b7f010e1dde11596eb18 /drivers/spi
parente86836883a8a624680f247c7ac200538c6a5ebaa (diff)
downloadlwn-f626a0cd07ddb13f146e52adb4b534da40bb1ff7.tar.gz
lwn-f626a0cd07ddb13f146e52adb4b534da40bb1ff7.zip
spi: zynq-qspi: Replace kzalloc with kmalloc for buffer allocation
In zynq_qspi_exec_mem_op(), the temporary buffer is allocated with kzalloc and then immediately initialized using memset to 0xff. To optimize this, replace kzalloc with kmalloc, as the zeroing operation is redundant and unnecessary. Signed-off-by: Kuan-Wei Chiu <visitorckw@gmail.com> Reviewed-by: Michal Simek <michal.simek@amd.com> Link: https://patch.msgid.link/20240814192839.345523-1-visitorckw@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/spi-zynq-qspi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/spi/spi-zynq-qspi.c b/drivers/spi/spi-zynq-qspi.c
index d6325c6be3d4..b67455bda972 100644
--- a/drivers/spi/spi-zynq-qspi.c
+++ b/drivers/spi/spi-zynq-qspi.c
@@ -569,7 +569,7 @@ static int zynq_qspi_exec_mem_op(struct spi_mem *mem,
}
if (op->dummy.nbytes) {
- tmpbuf = kzalloc(op->dummy.nbytes, GFP_KERNEL);
+ tmpbuf = kmalloc(op->dummy.nbytes, GFP_KERNEL);
if (!tmpbuf)
return -ENOMEM;