aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKuan-Wei Chiu <[email protected]>2024-08-15 03:28:39 +0800
committerMark Brown <[email protected]>2024-09-02 19:17:44 +0100
commitf626a0cd07ddb13f146e52adb4b534da40bb1ff7 (patch)
tree4f1f78ea6daf21f65318b7f010e1dde11596eb18
parente86836883a8a624680f247c7ac200538c6a5ebaa (diff)
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 <[email protected]> Reviewed-by: Michal Simek <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
-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;