Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/3] iio: adc: xilinx-ams: refactor alarm handling to table-driven design
@ 2026-05-13  0:31 Guilherme Ivo Bozi
  2026-05-13  0:31 ` [PATCH v4 1/3] iio: adc: xilinx-ams: fix out-of-bounds channel lookup in event handling Guilherme Ivo Bozi
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Guilherme Ivo Bozi @ 2026-05-13  0:31 UTC (permalink / raw)
  To: anand.ashok.dumbre, andy, conall.ogriofa, dlechner, jic23,
	manish.narani, michal.simek, nuno.sa, salih.erim
  Cc: Guilherme Ivo Bozi, Jonathan.Cameron, linux-arm-kernel, linux-iio

This series addresses significant code duplication in alarm handling
logic across the Xilinx AMS IIO driver.

To address this, the series introduces a centralized table-driven
mapping (alarm_map) that replaces multiple switch statements spread
across the driver.

This improves:
- maintainability (single source of truth for mappings)
- readability (removes repeated switch logic)
- extensibility (new alarms require only table updates)

No functional changes are intended.

Series overview:
- Patch 1: fix out-of-bounds channel lookup 
- Patch 2: convert mutex handling to guard(mutex) 
- Patch 3: introduce table-driven alarm mapping

v1 -> v2:
- Fixed Fixes tag format
- Replaced AMS_ALARM_INVALID with AMS_ALARM_NONE
- Changed alarm_map base_offset type

v2 -> v3:
- Replace 'i >= num_channels' with 'i == num_channels'
- Add missing trailing comma in alarm_map array initializer

v3 -> v4:
- Removed unnecessary 'event < 0' check for type e32

Guilherme Ivo Bozi (3):
  iio: adc: xilinx-ams: fix out-of-bounds channel lookup in event
    handling
  iio: adc: xilinx-ams: use guard(mutex) for automatic locking
  iio: adc: xilinx-ams: refactor alarm mapping to table-driven approach

 drivers/iio/adc/xilinx-ams.c | 190 +++++++++++++----------------------
 1 file changed, 71 insertions(+), 119 deletions(-)

-- 
2.47.3



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-05-14  1:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-13  0:31 [PATCH v4 0/3] iio: adc: xilinx-ams: refactor alarm handling to table-driven design Guilherme Ivo Bozi
2026-05-13  0:31 ` [PATCH v4 1/3] iio: adc: xilinx-ams: fix out-of-bounds channel lookup in event handling Guilherme Ivo Bozi
2026-05-13  0:31 ` [PATCH v4 2/3] iio: adc: xilinx-ams: use guard(mutex) for automatic locking Guilherme Ivo Bozi
2026-05-13  0:31 ` [PATCH v4 3/3] iio: adc: xilinx-ams: refactor alarm mapping to table-driven approach Guilherme Ivo Bozi
2026-05-14  1:21 ` [PATCH v4 0/3] iio: adc: xilinx-ams: refactor alarm handling to table-driven design Salih Erim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox