Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Kuan-Wei Chiu and committed by
Mark Brown
f626a0cd e8683688

+1 -1
+1 -1
drivers/spi/spi-zynq-qspi.c
··· 569 569 } 570 570 571 571 if (op->dummy.nbytes) { 572 - tmpbuf = kzalloc(op->dummy.nbytes, GFP_KERNEL); 572 + tmpbuf = kmalloc(op->dummy.nbytes, GFP_KERNEL); 573 573 if (!tmpbuf) 574 574 return -ENOMEM; 575 575