Re: [PATCH v7 07/10] iio: pressure: dps310: read buffered samples from the hardware FIFO
From: Rupesh Majhi
Date: Mon Sep 21 2026 - 14:54:10 EST
On Sun, 20 Sep 2026 19:32:13 +0100
Jonathan Cameron <jic23@xxxxxxxxxx> wrote:
> Given n is used in a couple of places, I'd keep the handling simple
> by doing it as
> for (i = 0, n = 0; i < DPS310_FIFO_DEPTH; i++, n++)
Gone down to one counter, since n only ever tracked i here. Patch 9 adds
a max_scans break after the store, where that form would lose the last
entry read, so there the test moved to the top of the loop.
> > + data->fifo_hold = NULL;
>
> Why clear fifo_hold? Nothing ever checks if it is NULL.
Nothing does, so the function had nothing left to do and both callers
just kfree() now. The clearing moved to the alloc side, otherwise a
pressure session followed by a temperature-only one double frees.
Rupesh