* [PATCH] staging: fbtft: Fix endian sparse warnings
@ 2015-10-21 15:00 Amitoj Kaur Chawla
2015-10-25 2:36 ` [Outreachy kernel] " Greg KH
0 siblings, 1 reply; 2+ messages in thread
From: Amitoj Kaur Chawla @ 2015-10-21 15:00 UTC (permalink / raw)
To: outreachy-kernel
Fix a bug found using sparse which generates the following warnings:
drivers/staging/fbtft/fbtft-io.c:78:29: warning: incorrect type in
assignment (different base types)
drivers/staging/fbtft/fbtft-io.c:78:29: expected unsigned long long
[unsigned] [long] [long long] [usertype] <noident>
drivers/staging/fbtft/fbtft-io.c:78:29: got restricted __be64
[usertype] <noident>
Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
---
drivers/staging/fbtft/fbtft-io.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/fbtft/fbtft-io.c b/drivers/staging/fbtft/fbtft-io.c
index a6f091f..a9a46c2 100644
--- a/drivers/staging/fbtft/fbtft-io.c
+++ b/drivers/staging/fbtft/fbtft-io.c
@@ -75,7 +75,7 @@ int fbtft_write_spi_emulate_9(struct fbtft_par *par, void *buf, size_t len)
src++;
}
tmp |= ((*src & 0x0100) ? 1 : 0);
- *(u64 *)dst = cpu_to_be64(tmp);
+ *(__be64 *)dst = cpu_to_be64(tmp);
dst += 8;
*dst++ = (u8)(*src++ & 0x00FF);
added++;
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Outreachy kernel] [PATCH] staging: fbtft: Fix endian sparse warnings
2015-10-21 15:00 [PATCH] staging: fbtft: Fix endian sparse warnings Amitoj Kaur Chawla
@ 2015-10-25 2:36 ` Greg KH
0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2015-10-25 2:36 UTC (permalink / raw)
To: Amitoj Kaur Chawla; +Cc: outreachy-kernel
On Wed, Oct 21, 2015 at 08:30:44PM +0530, Amitoj Kaur Chawla wrote:
> Fix a bug found using sparse which generates the following warnings:
>
> drivers/staging/fbtft/fbtft-io.c:78:29: warning: incorrect type in
> assignment (different base types)
> drivers/staging/fbtft/fbtft-io.c:78:29: expected unsigned long long
> [unsigned] [long] [long long] [usertype] <noident>
> drivers/staging/fbtft/fbtft-io.c:78:29: got restricted __be64
> [usertype] <noident>
>
> Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
> ---
> drivers/staging/fbtft/fbtft-io.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/fbtft/fbtft-io.c b/drivers/staging/fbtft/fbtft-io.c
> index a6f091f..a9a46c2 100644
> --- a/drivers/staging/fbtft/fbtft-io.c
> +++ b/drivers/staging/fbtft/fbtft-io.c
> @@ -75,7 +75,7 @@ int fbtft_write_spi_emulate_9(struct fbtft_par *par, void *buf, size_t len)
> src++;
> }
> tmp |= ((*src & 0x0100) ? 1 : 0);
> - *(u64 *)dst = cpu_to_be64(tmp);
> + *(__be64 *)dst = cpu_to_be64(tmp);
Are you sure this is correct? Why isn't dst declared as be64 to start
with? And don't use the __ form of variables unless they are crossing
the user/kernel boundry in a structure somehow.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-10-25 8:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-21 15:00 [PATCH] staging: fbtft: Fix endian sparse warnings Amitoj Kaur Chawla
2015-10-25 2:36 ` [Outreachy kernel] " Greg KH
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.