From: Greg KH <gregkh@linuxfoundation.org>
To: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Cc: outreachy-kernel@googlegroups.com
Subject: Re: [Outreachy kernel] [PATCH] staging: fbtft: Fix endian sparse warnings
Date: Sat, 24 Oct 2015 19:36:56 -0700 [thread overview]
Message-ID: <20151025023656.GA4565@kroah.com> (raw)
In-Reply-To: <20151021150043.GA2840@amitoj-Inspiron-3542>
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
prev parent reply other threads:[~2015-10-25 8:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-21 15:00 [PATCH] staging: fbtft: Fix endian sparse warnings Amitoj Kaur Chawla
2015-10-25 2:36 ` Greg KH [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20151025023656.GA4565@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=amitoj1606@gmail.com \
--cc=outreachy-kernel@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.