[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-rdma
Subject:    Re: [PATCH] RDMA/rtrs: Avoid Wtautological-constant-out-of-range-compare
From:       Jason Gunthorpe <jgg () ziepe ! ca>
Date:       2021-05-31 18:43:31
Message-ID: 20210531184331.GL1096940 () ziepe ! ca
[Download RAW message or body]

On Mon, May 31, 2021 at 02:28:35PM +0200, Jack Wang wrote:
> drivers/infiniband/ulp/rtrs/rtrs-clt.c:1786:19: warning: result of comparison of
> constant 'MAX_SESS_QUEUE_DEPTH' (65536) with expression of type 'u16'
> (aka 'unsigned short') is always false [-Wtautological-constant-out-of-range-compare]
> 
> To fix it, limit MAX_SESS_QUEUE_DEPTH to u16 max, which is 65535, and
> drop the check in rtrs-clt, as it's the type u16 max.
> 
> Signed-off-by: Jack Wang <jinpu.wang@ionos.com>
> ---
>  drivers/infiniband/ulp/rtrs/rtrs-clt.c | 5 -----
>  drivers/infiniband/ulp/rtrs/rtrs-pri.h | 4 ++--
>  2 files changed, 2 insertions(+), 7 deletions(-)

I kept the patch as is since the first hunk gets wonky conflicts if it
is squashed

Jason
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic