lkml.org 
[lkml]   [2023]   [Jul]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH v2 04/15] spi: Replace open coded spi_controller_xfer_timeout()
    On Mon, Jul 10, 2023 at 06:49:21PM +0300, Andy Shevchenko wrote:

    > Since the new spi_controller_xfer_timeout() helper appeared,
    > we may replace open coded variant in spi_transfer_wait().

    > + * Assume speed to be 100 kHz if it's not defined at the time of invocation.
    > + *

    You didn't mention this bit in the changelog, and I'm not 100% convinced
    it was the best idea in the first place. It's going to result in some
    very big timeouts if it goes off, and we really should be doing
    validation much earlier in the process.

    > + u32 speed_hz = xfer->speed_hz ?: 100000;

    Not only the ternery operator, but the version without the second
    argument for extra clarity!
    [unhandled content-type:application/pgp-signature]
    \
     
     \ /
      Last update: 2023-07-10 19:31    [W:2.228 / U:0.668 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site