spi: rockchip: covert rsd_nsecs to u32 type
authorShawn Lin <shawn.lin@rock-chips.com>
Thu, 10 Mar 2016 06:52:27 +0000 (14:52 +0800)
committerMark Brown <broonie@kernel.org>
Thu, 10 Mar 2016 08:06:53 +0000 (15:06 +0700)
rsd_nsecs is defined as u8 memeber of struct rockchip_spi,
but using of_property_read_u32. That means we take risk of
truncation by type conversion if we pass on big value from
dt.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-rockchip.c

index 1b54f2f180215f0b55931dda4fd4b39e51ce6c8b..5488597cfad4016af4c907f097ab49ff2d318479 100644 (file)
@@ -173,7 +173,7 @@ struct rockchip_spi {
        u8 tmode;
        u8 bpw;
        u8 n_bytes;
-       u8 rsd_nsecs;
+       u32 rsd_nsecs;
        unsigned len;
        u32 speed;