Commit f626a0cd authored by Kuan-Wei Chiu's avatar Kuan-Wei Chiu Committed by Mark Brown

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: default avatarKuan-Wei Chiu <visitorckw@gmail.com>
Reviewed-by: default avatarMichal Simek <michal.simek@amd.com>
Link: https://patch.msgid.link/20240814192839.345523-1-visitorckw@gmail.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent e8683688
...@@ -569,7 +569,7 @@ static int zynq_qspi_exec_mem_op(struct spi_mem *mem, ...@@ -569,7 +569,7 @@ static int zynq_qspi_exec_mem_op(struct spi_mem *mem,
} }
if (op->dummy.nbytes) { if (op->dummy.nbytes) {
tmpbuf = kzalloc(op->dummy.nbytes, GFP_KERNEL); tmpbuf = kmalloc(op->dummy.nbytes, GFP_KERNEL);
if (!tmpbuf) if (!tmpbuf)
return -ENOMEM; return -ENOMEM;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment