linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@ziepe.ca>
To: "Marciniszyn, Mike" <mike.marciniszyn@intel.com>
Cc: Leon Romanovsky <leon@kernel.org>,
	"Dalessandro, Dennis" <dennis.dalessandro@intel.com>,
	"dledford@redhat.com" <dledford@redhat.com>,
	"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>,
	"Wan, Kaike" <kaike.wan@intel.com>
Subject: Re: [PATCH for-rc 3/3] IB/hfi1: Correct tid qp rcd to match verbs context
Date: Mon, 10 Jun 2019 10:25:11 -0300	[thread overview]
Message-ID: <20190610132511.GB18468@ziepe.ca> (raw)
In-Reply-To: <32E1700B9017364D9B60AED9960492BC70DA2848@fmsmsx120.amr.corp.intel.com>

On Mon, Jun 10, 2019 at 01:03:54PM +0000, Marciniszyn, Mike wrote:
> > > diff --git a/drivers/infiniband/hw/hfi1/tid_rdma.c
> > b/drivers/infiniband/hw/hfi1/tid_rdma.c
> > > index 6fb9303..d77276d 100644
> > > +++ b/drivers/infiniband/hw/hfi1/tid_rdma.c
> > > @@ -312,9 +312,8 @@ static struct hfi1_ctxtdata *qp_to_rcd(struct
> > rvt_dev_info *rdi,
> > >  	if (qp->ibqp.qp_num == 0)
> > >  		ctxt = 0;
> > >  	else
> > > -		ctxt = ((qp->ibqp.qp_num >> dd->qos_shift) %
> > > -			(dd->n_krcv_queues - 1)) + 1;
> > > -
> > > +		ctxt = hfi1_get_qp_map(dd,
> > > +				       (u8)(qp->ibqp.qp_num >> dd-
> > >qos_shift));
> > 
> > It is one time use functions, why don't you handle this (u8) casting
> > inside of hfi1_get_qp_map()?
> > 
> 
> I assume the suggestion is to remove the u8 cast at the call site?
> 
> The function return value already is a u8 and there is a cast of the 64 bit CSR read result.

Why do you need an explicit cast at all?

Jason

      parent reply	other threads:[~2019-06-10 13:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20190607113807.157915.48581.stgit@awfm-01.aw.intel.com>
2019-06-07 12:25 ` [PATCH for-rc 1/3] IB/hfi1: Validate fault injection opcode user input Dennis Dalessandro
2019-06-11 20:11   ` Jason Gunthorpe
2019-06-07 12:25 ` [PATCH for-rc 2/3] IB/hfi1: Close PSM sdma_progress sleep window Dennis Dalessandro
2019-06-07 12:25 ` [PATCH for-rc 3/3] IB/hfi1: Correct tid qp rcd to match verbs context Dennis Dalessandro
2019-06-08  8:15   ` Leon Romanovsky
2019-06-10 13:03     ` Marciniszyn, Mike
2019-06-10 13:10       ` Leon Romanovsky
2019-06-10 13:25       ` Jason Gunthorpe [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=20190610132511.GB18468@ziepe.ca \
    --to=jgg@ziepe.ca \
    --cc=dennis.dalessandro@intel.com \
    --cc=dledford@redhat.com \
    --cc=kaike.wan@intel.com \
    --cc=leon@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=mike.marciniszyn@intel.com \
    --cc=stable@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).