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 Mon, Oct 02, 2017 at 11:04:33AM -0700, Dennis Dalessandro wrote:
> From: Don Hiatt <don.hiatt@xxxxxxxxx>
>
> The LIDs passed to opa_extended_lid are in __be32 format,
> change function signature accordingly.
>
> This fixes the following sparse warnings:
>   drivers/infiniband/core/cm.c:1181:60: warning: incorrect type in
> 	argument 1 (different ba
>   drivers/infiniband/core/cm.c:1182:60: warning: incorrect type in
> 	argument 2 (different ba
>   drivers/infiniband/core/cm.c:1242:68: warning: incorrect type in
> 	argument 1 (different ba
>   drivers/infiniband/core/cm.c:1243:68: warning: incorrect type in
> 	argument 2 (different ba
>   drivers/infiniband/core/cm.c:2922:66: warning: incorrect type in
> 	argument 1 (different ba
>   drivers/infiniband/core/cm.c:2923:66: warning: incorrect type in
> 	argument 2 (different ba
>   include/rdma/opa_addr.h:102:14: warning: cast to restricted __be32
>
> Fixes: e92aa00a5189 ("IB/CM: Add OPA Path record support to CM")
> Reviewed-by: Mike Marciniszyn <mike.marciniszyn@xxxxxxxxx>
> Signed-off-by: Don Hiatt <don.hiatt@xxxxxxxxx>
> Signed-off-by: Dennis Dalessandro <dennis.dalessandro@xxxxxxxxx>
> ---
>  include/rdma/opa_addr.h |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/include/rdma/opa_addr.h b/include/rdma/opa_addr.h
> index e6e90f1..f68fca2 100644
> --- a/include/rdma/opa_addr.h
> +++ b/include/rdma/opa_addr.h
> @@ -97,15 +97,15 @@ static inline u32 opa_get_lid_from_gid(const union ib_gid *gid)
>   * @dlid: The DLID
>   * @slid: The SLID
>   */
> -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.

>  		return true;
> -	else
> -		return false;
> +
> +	return false;
>  }
>
>  /* Get multicast lid base */
>
> --
> 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