All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Cc: outreachy-kernel@googlegroups.com
Subject: Re: [Outreachy kernel] [PATCH 3/3] staging: lustre: lnet: Fix endian sparse warnings
Date: Sat, 24 Oct 2015 18:49:14 -0700	[thread overview]
Message-ID: <20151025014914.GB536@kroah.com> (raw)
In-Reply-To: <661be4508c123053e8c41b7810f53676fba06eb7.1445453573.git.amitoj1606@gmail.com>

On Thu, Oct 22, 2015 at 12:33:11AM +0530, Amitoj Kaur Chawla wrote:
> Fix bug found using sparse which generates the following warning:
> 
> drivers/staging/lustre/lnet/lnet/lib-msg.c:72:37: warning: cast to
> restricted __le64
> drivers/staging/lustre/lnet/lnet/lib-msg.c:73:37: warning: cast to
> restricted __le32
> drivers/staging/lustre/lnet/lnet/lib-msg.c:116:42: warning: cast to
> restricted __le32
> drivers/staging/lustre/lnet/lnet/lib-msg.c:117:42: warning: cast to
> restricted __le64
> drivers/staging/lustre/lnet/lnet/lib-msg.c:118:42: warning: cast to
> restricted __le32
> drivers/staging/lustre/lnet/lnet/lib-msg.c:120:42: warning: cast to
> restricted __le32
> drivers/staging/lustre/lnet/lnet/lib-msg.c:121:42: warning: cast to
> restricted __le64
> drivers/staging/lustre/lnet/lnet/lib-msg.c:125:42: warning: cast to
> restricted __le32
> drivers/staging/lustre/lnet/lnet/lib-msg.c:126:42: warning: cast to
> restricted __le64
> drivers/staging/lustre/lnet/lnet/lib-msg.c:128:42: warning: cast to
> restricted __le32
> drivers/staging/lustre/lnet/lnet/lib-msg.c:129:42: warning: cast to
> restricted __le32
> drivers/staging/lustre/lnet/lnet/lib-msg.c:384:46: warning: incorrect
> type in assignment (different base types)
> drivers/staging/lustre/lnet/lnet/lib-msg.c:384:46: expected unsigned
> int [unsigned] [usertype] mlength
> drivers/staging/lustre/lnet/lnet/lib-msg.c:384:46: got restricted
> __le32 [usertype] <noident>
> 
> Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
> ---
>  drivers/staging/lustre/lnet/lnet/lib-msg.c | 24 ++++++++++++------------
>  1 file changed, 12 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/staging/lustre/lnet/lnet/lib-msg.c b/drivers/staging/lustre/lnet/lnet/lib-msg.c
> index 43977e8..4ad9a340 100644
> --- a/drivers/staging/lustre/lnet/lnet/lib-msg.c
> +++ b/drivers/staging/lustre/lnet/lnet/lib-msg.c
> @@ -69,8 +69,8 @@ lnet_build_msg_event(lnet_msg_t *msg, lnet_event_kind_t ev_type)
>  
>  	if (ev_type == LNET_EVENT_SEND) {
>  		/* event for active message */
> -		ev->target.nid    = le64_to_cpu(hdr->dest_nid);
> -		ev->target.pid    = le32_to_cpu(hdr->dest_pid);
> +		ev->target.nid    = hdr->dest_nid;
> +		ev->target.pid    = hdr->dest_pid;
>  		ev->initiator.nid = LNET_NID_ANY;
>  		ev->initiator.pid = the_lnet.ln_pid;
>  		ev->sender        = LNET_NID_ANY;
> @@ -113,20 +113,20 @@ lnet_build_msg_event(lnet_msg_t *msg, lnet_event_kind_t ev_type)
>  
>  	case LNET_EVENT_SEND: /* active message */
>  		if (msg->msg_type == LNET_MSG_PUT) {
> -			ev->pt_index   = le32_to_cpu(hdr->msg.put.ptl_index);
> -			ev->match_bits = le64_to_cpu(hdr->msg.put.match_bits);
> -			ev->offset     = le32_to_cpu(hdr->msg.put.offset);
> +			ev->pt_index   = hdr->msg.put.ptl_index;
> +			ev->match_bits = hdr->msg.put.match_bits;
> +			ev->offset     = hdr->msg.put.offset;
>  			ev->mlength    =
> -			ev->rlength    = le32_to_cpu(hdr->payload_length);
> -			ev->hdr_data   = le64_to_cpu(hdr->msg.put.hdr_data);
> +			ev->rlength    = hdr->payload_length;
> +			ev->hdr_data   = hdr->msg.put.hdr_data;
>  
>  		} else {
>  			LASSERT(msg->msg_type == LNET_MSG_GET);
> -			ev->pt_index   = le32_to_cpu(hdr->msg.get.ptl_index);
> -			ev->match_bits = le64_to_cpu(hdr->msg.get.match_bits);
> +			ev->pt_index   = hdr->msg.get.ptl_index;
> +			ev->match_bits = hdr->msg.get.match_bits;
>  			ev->mlength    =
> -			ev->rlength    = le32_to_cpu(hdr->msg.get.sink_length);
> -			ev->offset     = le32_to_cpu(hdr->msg.get.src_offset);
> +			ev->rlength    = hdr->msg.get.sink_length;
> +			ev->offset     = hdr->msg.get.src_offset;
>  			ev->hdr_data   = 0;
>  		}
>  		return;
> @@ -381,7 +381,7 @@ lnet_complete_msg_locked(lnet_msg_t *msg, int cpt)
>  
>  		msg->msg_hdr.msg.ack.dst_wmd = ack_wmd;
>  		msg->msg_hdr.msg.ack.match_bits = msg->msg_ev.match_bits;
> -		msg->msg_hdr.msg.ack.mlength = cpu_to_le32(msg->msg_ev.mlength);
> +		msg->msg_hdr.msg.ack.mlength = msg->msg_ev.mlength;

Same issue with this patch, I think you just broke things :(


      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   ` [Outreachy kernel] " Greg KH
2015-10-25 14:11     ` Amitoj Kaur Chawla
2015-10-21 19:03 ` [PATCH 3/3] staging: lustre: lnet: " Amitoj Kaur Chawla
2015-10-25  1:49   ` 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=20151025014914.GB536@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.