Re: [PATCH for-next 5/8] IB/core: Use __be32 for LIDs in opa_is_extended_lid

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Oct 03, 2017 at 10:00:59AM -0600, Jason Gunthorpe wrote:
> On Tue, Oct 03, 2017 at 09:16:57AM +0300, Leon Romanovsky wrote:
>
> > > -static inline bool opa_is_extended_lid(u32 dlid, u32 slid)
> > > +static inline bool opa_is_extended_lid(__be32 dlid, __be32 slid)
> > >  {
> > >  	if ((be32_to_cpu(dlid) >=
> > >  	     be16_to_cpu(IB_MULTICAST_LID_BASE)) ||
> > >  	    (be32_to_cpu(slid) >=
> > >  	     be16_to_cpu(IB_MULTICAST_LID_BASE)))
> >
> > You can drop be32_to_cpu and be16_to_cpu now.
> > The dlid is __be32 and IB_MULTICAST_LID_BASE is __be16. The direct
> > comparison will work.
>
> It won't order properly for >=, the swap is still needed...

Jason,
Do you have reference for that?

I tried to find any information about comparison of values from one
endianess on machine with another endianess and didn't find anything
relevant.

Thanks

>
> Jason
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux