OSDN Git Service

spi: bcm2835aux: Avoid 64-bit arithmetic in xfer len calc
authorTrent Piepho <tpiepho@impinj.com>
Mon, 12 Feb 2018 19:38:14 +0000 (11:38 -0800)
committerMark Brown <broonie@kernel.org>
Wed, 14 Feb 2018 16:04:58 +0000 (16:04 +0000)
commitd704afffe65c8fab424963c1ba4ec4364c2d6a82
treea572223ff30a9db9558305b3b6b83ae8bc83f31d
parent7928b2cbe55b2a410a0f5c1f154610059c57b1b2
spi: bcm2835aux: Avoid 64-bit arithmetic in xfer len calc

We want to check for xfers that are over 30 microseconds.  Rather than
find how many µs a xfer will take, instead find how many bytes can be
transferred in 30 µs.  The latter must be less than 32 bits (since our
clock speed is limited to 32 bits), while the former involves 64 bit
quantities and more arithmetic operations.

Signed-off-by: Trent Piepho <tpiepho@impinj.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-bcm2835aux.c