Skip to contentSkip to conversation

staging: fbtft: Fix Sparse warning in fb_watterott.c

PATCH In review Cezary Gapinski 2 participants 2 messages Apr 21, 2017 – Apr 28, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: fbtft: Fix Sparse warning in fb_watterott.c

Sparse reports the following in fb_watterott.c:

warning: incorrect type in assignment (different base types) expected unsigned short [unsigned] [short] [usertype] <noident> got restricted __be16 [usertype] <noident>

Use __be16 types for endian correctness

---
 drivers/staging/fbtft/fb_watterott.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/fbtft/fb_watterott.c +3 -3
index 4293045..180e5be 100644
@@ -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 = par->txbuf.buf + 1;
+	__be16 *buf16 = 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 = par->txbuf.buf + 1;
 	u8 *buf8 = par->txbuf.buf + 10;
 	int i, j;
 	int ret = 0;
Signature · 1 line
2.7.4
maintainer
#1 lore raw
Quoted 6 lines · Cezary Gapinski

Sparse reports the following in fb_watterott.c:

warning: incorrect type in assignment (different base types) expected unsigned short [unsigned] [short] [usertype] <noident> got restricted __be16 [usertype] <noident>

Quoted 6 lines

Use __be16 types for endian correctness

---
 drivers/staging/fbtft/fb_watterott.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Patch does not apply to my tree :(