Skip to content

Commit f626a0c

Browse files
visitorckwbroonie
authored andcommitted
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>
1 parent e868368 commit f626a0c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/spi/spi-zynq-qspi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ static int zynq_qspi_exec_mem_op(struct spi_mem *mem,
569569
}
570570

571571
if (op->dummy.nbytes) {
572-
tmpbuf = kzalloc(op->dummy.nbytes, GFP_KERNEL);
572+
tmpbuf = kmalloc(op->dummy.nbytes, GFP_KERNEL);
573573
if (!tmpbuf)
574574
return -ENOMEM;
575575

0 commit comments

Comments
 (0)