lkml.org 
[lkml]   [2020]   [Jul]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] IB/hfi1: Add explicit cast OPA_MTU_8192 to 'enum ib_mtu'
On Mon, Jun 22, 2020 at 05:52:24PM -0700, Nathan Chancellor wrote:
> Clang warns:
>
> drivers/infiniband/hw/hfi1/qp.c:198:9: warning: implicit conversion from
> enumeration type 'enum opa_mtu' to different enumeration type 'enum
> ib_mtu' [-Wenum-conversion]
> mtu = OPA_MTU_8192;
> ~ ^~~~~~~~~~~~
> 1 warning generated.
>
> enum opa_mtu extends enum ib_mtu. There are typically two ways to deal
> with this:
>
> * Remove the expected types and just use 'int' for all parameters and
> types.
>
> * Explicitly cast the enums between each other.
>
> This driver chooses to do the later so do the same thing here.
>
> Fixes: 6d72344cf6c4 ("IB/ipoib: Increase ipoib Datagram mode MTU's upper limit")
> Link: https://github.com/ClangBuiltLinux/linux/issues/1062
> Link: https://lore.kernel.org/linux-rdma/20200527040350.GA3118979@ubuntu-s3-xlarge-x86/
> Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
> Acked-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
> ---
> drivers/infiniband/hw/hfi1/qp.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

Applied to for-rc, thanks

Jason

\
 
 \ /
  Last update: 2020-07-02 16:26    [W:0.082 / U:0.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site