]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
iio: st_sensors: drop temporary kmalloc buffer and reuse buffer_data
authorSanjay Chitroda <sanjayembeddedse@gmail.com>
Sun, 15 Mar 2026 12:16:25 +0000 (17:46 +0530)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 21 Mar 2026 20:09:55 +0000 (20:09 +0000)
commit1ac30f58f0336287203109872f71a81d4bb271db
tree75f1c0fc899e2963a1a5415ddeef2a3a4373a54a
parent733bcf18eab0cbcea7b1a85c967dc100945fffc3
iio: st_sensors: drop temporary kmalloc buffer and reuse buffer_data

Replace the per-call kmalloc() scratch buffer with the existing
buffer_data[] field present in struct st_sensor_data. The existing buffer
is DMA-aligned and sufficiently sized for all channel widths, so using it
avoids unnecessary dynamic memory allocation on each read.

This simplifies the code, removes redundant allocation and cleanup.
No functional change intended.

Signed-off-by: Sanjay Chitroda <sanjayembeddedse@gmail.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/common/st_sensors/st_sensors_core.c