Re: [PATCH 1/5] RDMA/ib_hdrs.h: Remove a superfluous cast

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

 



On Tue, May 11, 2021 at 08:27:48PM -0700, Bart Van Assche wrote:
> be16_to_cpu() returns a u16 value. Remove the superfluous u16 cast. That
> cast was introduced by commit 7dafbab3753f ("IB/hfi1: Add functions to
> parse BTH/IB headers").
> 
> Cc: Don Hiatt <don.hiatt@xxxxxxxxx>
> Cc: Dennis Dalessandro <dennis.dalessandro@xxxxxxxxx>
> Signed-off-by: Bart Van Assche <bvanassche@xxxxxxx>
> ---
>  include/rdma/ib_hdrs.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/rdma/ib_hdrs.h b/include/rdma/ib_hdrs.h
> index 57c1ac881d08..82483120539f 100644
> --- a/include/rdma/ib_hdrs.h
> +++ b/include/rdma/ib_hdrs.h
> @@ -208,7 +208,7 @@ static inline u8 ib_get_lver(struct ib_header *hdr)
>  
>  static inline u16 ib_get_len(struct ib_header *hdr)
>  {
> -	return (u16)(be16_to_cpu(hdr->lrh[2]));
> +	return be16_to_cpu(hdr->lrh[2]);
>  }
>  
>  static inline u32 ib_get_qkey(struct ib_other_headers *ohdr)

It is unclear why this function in the header. It is called only once.

Thanks,
Reviewed-by: Leon Romanovsky <leonro@xxxxxxxxxx>



[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