Commit 52267fe
spi: use spi_valid_{tx,rx}buf() in stats function
There are macros spi_valid_txbuf() and spi_valid_rxbuf() for determining
if an xfer actually intended to send or receive data.
These checks were hard-coded in spi_statistics_add_transfer_stats(). We
can make use of the macros instead to make the code more readable and
more robust against potential future changes in case the definition of
what valid means changes.
The macro takes the spi_message as an argument, so we need to change
spi_statistics_add_transfer_stats() to take the spi_message as an
argument instead of the controller.
Signed-off-by: David Lechner <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>1 parent 4776679 commit 52267fe
1 file changed
+5
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
312 | 312 | | |
313 | 313 | | |
314 | 314 | | |
315 | | - | |
| 315 | + | |
316 | 316 | | |
317 | 317 | | |
318 | 318 | | |
| |||
328 | 328 | | |
329 | 329 | | |
330 | 330 | | |
331 | | - | |
332 | | - | |
| 331 | + | |
333 | 332 | | |
334 | | - | |
335 | | - | |
| 333 | + | |
336 | 334 | | |
337 | 335 | | |
338 | 336 | | |
| |||
1618 | 1616 | | |
1619 | 1617 | | |
1620 | 1618 | | |
1621 | | - | |
1622 | | - | |
| 1619 | + | |
| 1620 | + | |
1623 | 1621 | | |
1624 | 1622 | | |
1625 | 1623 | | |
| |||
0 commit comments