[PATCH 1/1] Staging: FBTFT: Fix wrong type casting warnings generated by sparse

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Fixed the following warnings reported by sparse:

drivers/staging/fbtft/fb_watterott.c:83:16: warning: incorrect type in assignment (different base types)
drivers/staging/fbtft/fb_watterott.c:83:16:    expected unsigned short [unsigned] [short] [usertype] <noident>
drivers/staging/fbtft/fb_watterott.c:83:16:    got restricted __be16 [usertype] <noident>
drivers/staging/fbtft/fb_watterott.c:84:16: warning: incorrect type in assignment (different base types)
drivers/staging/fbtft/fb_watterott.c:84:16:    expected unsigned short [unsigned] [short] [usertype] <noident>
drivers/staging/fbtft/fb_watterott.c:84:16:    got restricted __be16 [usertype] <noident>
drivers/staging/fbtft/fb_watterott.c:88:24: warning: incorrect type in assignment (different base types)
drivers/staging/fbtft/fb_watterott.c:88:24:    expected unsigned short [unsigned] [short] [usertype] <noident>
drivers/staging/fbtft/fb_watterott.c:88:24:    got restricted __be16 [usertype] <noident>
drivers/staging/fbtft/fb_watterott.c:90:34: warning: incorrect type in assignment (different base types)
drivers/staging/fbtft/fb_watterott.c:90:34:    expected unsigned short [unsigned] [short] [usertype] <noident>
drivers/staging/fbtft/fb_watterott.c:90:34:    got restricted __be16 [usertype] <noident>
drivers/staging/fbtft/fb_watterott.c:120:16: warning: incorrect type in assignment (different base types)
drivers/staging/fbtft/fb_watterott.c:120:16:    expected unsigned short [unsigned] [short] [usertype] <noident>
drivers/staging/fbtft/fb_watterott.c:120:16:    got restricted __be16 [usertype] <noident>
drivers/staging/fbtft/fb_watterott.c:121:16: warning: incorrect type in assignment (different base types)
drivers/staging/fbtft/fb_watterott.c:121:16:    expected unsigned short [unsigned] [short] [usertype] <noident>
drivers/staging/fbtft/fb_watterott.c:121:16:    got restricted __be16 [usertype] <noident>
drivers/staging/fbtft/fb_watterott.c:125:24: warning: incorrect type in assignment (different base types)
drivers/staging/fbtft/fb_watterott.c:125:24:    expected unsigned short [unsigned] [short] [usertype] <noident>
drivers/staging/fbtft/fb_watterott.c:125:24:    got restricted __be16 [usertype] <noident>

Signed-off-by: Mandel Benjamin <benyx.mandel@xxxxxxxxx>
---
 drivers/staging/fbtft/fb_watterott.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/fbtft/fb_watterott.c b/drivers/staging/fbtft/fb_watterott.c
index 429304546b44..276f7fe1dbe7 100644
--- a/drivers/staging/fbtft/fb_watterott.c
+++ b/drivers/staging/fbtft/fb_watterott.c
@@ -69,8 +69,8 @@ static int write_vmem(struct fbtft_par *par, size_t offset, size_t len)
 {
 	unsigned int start_line, end_line;
 	u16 *vmem16 = (u16 *)(par->info->screen_buffer + offset);
-	u16 *pos = par->txbuf.buf + 1;
-	u16 *buf16 = par->txbuf.buf + 10;
+	__be16 *pos = (__be16 *)par->txbuf.buf + 1;
+	__be16 *buf16 = (__be16 *)par->txbuf.buf + 10;
 	int i, j;
 	int ret = 0;
 
@@ -106,7 +106,7 @@ static int write_vmem_8bit(struct fbtft_par *par, size_t offset, size_t len)
 {
 	unsigned int start_line, end_line;
 	u16 *vmem16 = (u16 *)(par->info->screen_buffer + offset);
-	u16 *pos = par->txbuf.buf + 1;
+	__be16 *pos = (__be16 *)par->txbuf.buf + 1;
 	u8 *buf8 = par->txbuf.buf + 10;
 	int i, j;
 	int ret = 0;
-- 
2.11.0

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux