]> git.ipfire.org Git - thirdparty/linux.git/commit
media: rc: ir-spi: allocate buffer dynamically
authorCosmin Tanislav <demonsingur@gmail.com>
Fri, 13 Jun 2025 11:21:51 +0000 (14:21 +0300)
committerHans Verkuil <hverkuil@xs4all.nl>
Mon, 23 Jun 2025 10:11:04 +0000 (12:11 +0200)
commitc898efdd6ecc4a9f9f4d4114370e6ed477f66b8a
tree70f77f572c8e6a5526189c41bf534ef27bc5464c
parent803b9eabc649c778986449eb0596e5ffeb7a8aed
media: rc: ir-spi: allocate buffer dynamically

Replace the static transmit buffer with a dynamically allocated one,
removing the limit imposed on the number of pulses to transmit.

Calculate the number of pulses for each duration in the received buffer
ahead of time, while also adding up the total pulses, to be able to
allocate a buffer that perfectly fits the total number of pulses, then
populate it.

Signed-off-by: Cosmin Tanislav <demonsingur@gmail.com>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
drivers/media/rc/ir-spi.c