public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] staging: fbtft: Fix Sparse warning in fb_watterott.c
@ 2017-04-21 15:54 Cezary Gapinski
  2017-04-28 10:07 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Cezary Gapinski @ 2017-04-21 15:54 UTC (permalink / raw)
  To: gregkh; +Cc: thomas.petazzoni, devel, linux-kernel

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

Signed-off-by: Cezary Gapinski <gapalinux@gmail.com>
---
 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 4293045..180e5be 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 = 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;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/1] staging: fbtft: Fix Sparse warning in fb_watterott.c
  2017-04-21 15:54 [PATCH 1/1] staging: fbtft: Fix Sparse warning in fb_watterott.c Cezary Gapinski
@ 2017-04-28 10:07 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2017-04-28 10:07 UTC (permalink / raw)
  To: Cezary Gapinski; +Cc: devel, linux-kernel

On Fri, Apr 21, 2017 at 05:54:47PM +0200, Cezary Gapinski wrote:
> 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
> 
> Signed-off-by: Cezary Gapinski <gapalinux@gmail.com>
> ---
>  drivers/staging/fbtft/fb_watterott.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)

Patch does not apply to my tree :(

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-04-28 10:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-21 15:54 [PATCH 1/1] staging: fbtft: Fix Sparse warning in fb_watterott.c Cezary Gapinski
2017-04-28 10:07 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox