| #
4dd10fbb |
| 29-Oct-2026 |
Kees Cook <kees+treewide@kernel.org> |
treewide: Convert devm_kmalloc() family to the devm_kmalloc_obj() family
Mirroring the earlier kmalloc_obj() conversion, convert the device-managed allocators over to the type-based API using the no
treewide: Convert devm_kmalloc() family to the devm_kmalloc_obj() family
Mirroring the earlier kmalloc_obj() conversion, convert the device-managed allocators over to the type-based API using the now updated scripts/coccinelle/api/kmalloc_objs.cocci. The size is derived from the type rather than written out as a sizeof(), and the result is a pointer to that type rather than void *, so a mismatch between the size requested and the variable assigned becomes a build error instead of being silently accepted.
The conversions break down as:
6713 devm_kzalloc_obj() 1749 devm_kzalloc_objs() 307 devm_kzalloc_flex() 91 devm_kmalloc_objs() 82 devm_kmalloc_obj() 2 devm_kmalloc_flex()
The rules deliberately leave alone allocations sized by a string or a byte-sized type, or assigned to a pointer to a byte-sized type, since those are byte buffers rather than objects. Allocations sized by a multi-byte integer type are only converted when they are assigned to a pointer to that same type, and allocations of pointers to integers or of void pointers are left alone too. After this change, 528 files still call devm_kmalloc(), devm_kzalloc(), devm_kcalloc(), or devm_kmalloc_array().
Build tested with allmodconfig on x86_64, arm64, i386, arm, riscv, s390, m68k, mips, parisc, sparc, loongarch, arc, xtensa, and openrisc with GCC 16.2.0 with no new warnings.
Signed-off-by: Kees Cook <kees+treewide@kernel.org>
show more ...
|
| #
83858f2b |
| 23-Sep-2026 |
Jan Carlo Roleda <jancarlo.roleda@analog.com> |
leds: ltc3208: Add driver for LTC3208 Multidisplay LED Driver
Kernel driver implementation for LTC3208 Multidisplay LED Driver.
The LTC3208 is a Multi-display LED driver, designed to control up to
leds: ltc3208: Add driver for LTC3208 Multidisplay LED Driver
Kernel driver implementation for LTC3208 Multidisplay LED Driver.
The LTC3208 is a Multi-display LED driver, designed to control up to 7 distinct LED channels (MAIN, SUB, AUX, CAMHI, CAMLO, RED, GREEN, BLUE), each configurable with its own current level that is equally set to its respective output current source pins for external LEDs.
It is programmed via the I2C serial interface. MAIN and SUB support 8-bit current level resolution, while AUX, CAMHI/LO, RED, GREEN, and BLUE support 4-bit levels.
The AUX LED channel can be configured to mirror the CAM, SUB, and MAIN channel current levels, or as its own independent AUX channel.
The CAM LED channel is configured as 2 separate CAMHI and CAMLO register sub-channels, which current is selected via the CAMHL pin, or set to CAMHI register only via setting the S_CAMHILO bit high in register G (0x7).
Signed-off-by: Jan Carlo Roleda <jancarlo.roleda@analog.com> Link: https://patch.msgid.link/20260923003325.61722-3-jancarlo.roleda@analog.com Signed-off-by: Lee Jones <lee@kernel.org>
show more ...
|