RE: [PATCH 05/20] IB/mad: Change cast in rcv_has_same_class

Weiny, Ira
2015-01-14T16:19:07Z

>
> On 1/12/2015 7:10 PM, ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org wrote:
> > From: Ira Weiny <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> >
> > Save dereference and clarifies that rcv_has_same_class can process
> > both IB and OPA MADs.
>
> I don't see any clarification below... something missing here?

Nothing missing. I was trying to indicate that this change simply indicates that this function can operate on any buffer which has an ib_mad_hdr.

Ira

>
> >
> > Signed-off-by: Ira Weiny <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> > ---
> > drivers/infiniband/core/mad.c | 2 +-
> > 1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/drivers/infiniband/core/mad.c
> > b/drivers/infiniband/core/mad.c index 66b3940..819b794 100644
> > --- a/drivers/infiniband/core/mad.c
> > +++ b/drivers/infiniband/core/mad.c
> > @@ -1750,7 +1750,7 @@ static int is_rmpp_data_mad(struct
> ib_mad_agent_private *mad_agent_priv,
> > static inline int rcv_has_same_class(struct ib_mad_send_wr_private *wr,
> > struct ib_mad_recv_wc *rwc)
> > {
> > - return ((struct ib_mad *)(wr->send_buf.mad))->mad_hdr.mgmt_class
> ==
> > + return ((struct ib_mad_hdr *)(wr->send_buf.mad))->mgmt_class ==
> > rwc->recv_buf.mad->mad_hdr.mgmt_class;
> > }
> >