[PATCH 5/5] thermal/drivers/mediatek/lvts: Only update IRQ enable for valid sensors

AngeloGioacchino Del Regno angelogioacchino.delregno at collabora.com
Tue Nov 26 01:43:44 PST 2024


Il 25/11/24 22:20, Nícolas F. R. A. Prado ha scritto:
> Only sensors that are valid need to have their interrupts enable status
> updated based on their thresholds. Use the lvts_for_each_valid_sensor()
> helper in lvts_update_irq_mask() to ignore invalid sensors.
> 
> Currently, since the invalid sensors will always contain zeroed out
> thresholds (from kzalloc), they will always get their interrupts
> disabled on this loop. So this commit doesn't change the resulting
> interrupts configuration, but it slightly optimizes the loop by skipping
> the invalid sensors, avoids potential future surprises if at some point
> memory is no longer allocated for invalid sensors, as well as makes the
> code more obvious.
> 
> Signed-off-by: Nícolas F. R. A. Prado <nfraprado at collabora.com>

That's lovely.

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno at collabora.com>





More information about the Linux-mediatek mailing list