diff options
| author | Carlos Jones Jr <carlosjr.jones@analog.com> | 2026-03-31 09:24:57 +0800 |
|---|---|---|
| committer | Jonathan Cameron <jic23@kernel.org> | 2026-04-27 09:58:17 +0100 |
| commit | 7a89047a361c347cafe98f432d3df1686592ecce (patch) | |
| tree | d8f65ea58dbddc4c9e386fe99d7bbabea3673fb1 /tools/perf/scripts/python/stackcollapse.py | |
| parent | 671b8541c7d62818e0fb8ac7fe8a4086fc7c842e (diff) | |
iio: adc: ltc2309: Optimize chip_info structure layout
Improve the ltc2309_chip_info structure with better type safety and
memory efficiency:
- Add __counted_by_ptr() annotation to the channels pointer, linking
it to num_channels for improved bounds checking and kernel hardening
- Reorder structure fields to minimize padding:
* Place read_delay_us before num_channels
* This reduces struct size and eliminates internal gaps
- Reorder field initialization to match the structure definition order
The __counted_by_ptr() attribute enables compile-time and runtime
verification that array accesses to channels[] stay within the bounds
specified by num_channels, improving memory safety.
Signed-off-by: Carlos Jones Jr <carlosjr.jones@analog.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions
