* [PATCH 2/2] spi: rockchip: covert rsd_nsecs to u32 type
@ 2016-03-10 6:52 Shawn Lin
0 siblings, 0 replies; only message in thread
From: Shawn Lin @ 2016-03-10 6:52 UTC (permalink / raw)
To: Mark Brown; +Cc: linux-kernel, linux-spi, Shawn Lin
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>
---
drivers/spi/spi-rockchip.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/spi/spi-rockchip.c b/drivers/spi/spi-rockchip.c
index 7a4a131..26e2688 100644
--- a/drivers/spi/spi-rockchip.c
+++ b/drivers/spi/spi-rockchip.c
@@ -173,7 +173,7 @@ struct rockchip_spi {
u8 tmode;
u8 bpw;
u8 n_bytes;
- u8 rsd_nsecs;
+ u32 rsd_nsecs;
unsigned len;
u32 speed;
--
2.3.7
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2016-03-10 7:01 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-10 6:52 [PATCH 2/2] spi: rockchip: covert rsd_nsecs to u32 type Shawn Lin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).