From: Greg KH <gregkh@linuxfoundation.org>
To: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Cc: outreachy-kernel@googlegroups.com
Subject: Re: [Outreachy kernel] [PATCH 2/3] staging: lustre: lmv: Fix endian sparse warnings
Date: Sat, 24 Oct 2015 18:48:56 -0700 [thread overview]
Message-ID: <20151025014856.GA536@kroah.com> (raw)
In-Reply-To: <7c9a1c8af81dc6676b31d2ad2e8d9de2df9dfbd8.1445453573.git.amitoj1606@gmail.com>
On Thu, Oct 22, 2015 at 12:31:32AM +0530, Amitoj Kaur Chawla wrote:
> Fix bug found using sparse which generates the following warning:
>
> drivers/staging/lustre/lustre/lmv/lmv_obd.c:2422:25: warning:
> incorrect type in assignment (different base types)
> drivers/staging/lustre/lustre/lmv/lmv_obd.c:2422:25: expected unsigned
> int [unsigned] [usertype] mea_magic
> drivers/staging/lustre/lustre/lmv/lmv_obd.c:2422:25: got restricted
> __le32 [usertype] <noident>
> drivers/staging/lustre/lustre/lmv/lmv_obd.c:2423:25: warning:
> incorrect type in assignment (different base types)
> drivers/staging/lustre/lustre/lmv/lmv_obd.c:2423:25: expected unsigned
> int [unsigned] [usertype] mea_count
> drivers/staging/lustre/lustre/lmv/lmv_obd.c:2423:25: got restricted
> __le32 [usertype] <noident>
> drivers/staging/lustre/lustre/lmv/lmv_obd.c:2424:26: warning:
> incorrect type in assignment (different base types)
> drivers/staging/lustre/lustre/lmv/lmv_obd.c:2424:26: expected unsigned
> int [unsigned] [usertype] mea_master
> drivers/staging/lustre/lustre/lmv/lmv_obd.c:2424:26: got restricted
> __le32 [usertype] <noident>
> drivers/staging/lustre/lustre/lmv/lmv_obd.c:2467:25: warning: cast to
> restricted __le32
> drivers/staging/lustre/lustre/lmv/lmv_obd.c:2477:30: warning: cast to
> restricted __le32
> drivers/staging/lustre/lustre/lmv/lmv_obd.c:2478:31: warning: cast to
> restricted __le32
>
> Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
> ---
> drivers/staging/lustre/lustre/lmv/lmv_obd.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/staging/lustre/lustre/lmv/lmv_obd.c b/drivers/staging/lustre/lustre/lmv/lmv_obd.c
> index 7e6a060..8d90f19 100644
> --- a/drivers/staging/lustre/lustre/lmv/lmv_obd.c
> +++ b/drivers/staging/lustre/lustre/lmv/lmv_obd.c
> @@ -2419,9 +2419,9 @@ static int lmv_packmd(struct obd_export *exp, struct lov_mds_md **lmmp,
> lsmp->mea_magic != MEA_MAGIC_ALL_CHARS)
> return -EINVAL;
>
> - meap->mea_magic = cpu_to_le32(lsmp->mea_magic);
> - meap->mea_count = cpu_to_le32(lsmp->mea_count);
> - meap->mea_master = cpu_to_le32(lsmp->mea_master);
> + meap->mea_magic = lsmp->mea_magic;
> + meap->mea_count = lsmp->mea_count;
> + meap->mea_master = lsmp->mea_master;
Yes, deleting the calls will remove the warning, but maybe this isn't
the correct fix? I think you just broke the code :(
There is a better fix here, a "correct" one, can you think of it?
thanks,
greg k-h
next prev parent reply other threads:[~2015-10-25 8:27 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-21 18:57 [PATCH 0/3] staging: Fix endian sparse warnings Amitoj Kaur Chawla
2015-10-21 18:59 ` [PATCH 1/3] staging: rts5208: " Amitoj Kaur Chawla
2015-10-25 2:38 ` [Outreachy kernel] " Greg KH
2015-10-21 19:01 ` [PATCH 2/3] staging: lustre: lmv: " Amitoj Kaur Chawla
2015-10-25 1:48 ` Greg KH [this message]
2015-10-25 14:11 ` [Outreachy kernel] " Amitoj Kaur Chawla
2015-10-21 19:03 ` [PATCH 3/3] staging: lustre: lnet: " Amitoj Kaur Chawla
2015-10-25 1:49 ` [Outreachy kernel] " Greg KH
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=20151025014856.GA536@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.