Re: [PATCH] RDMA/rtrs: Avoid Wtautological-constant-out-of-range-compare

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

 



On Mon, May 31, 2021 at 8:43 PM Jason Gunthorpe <jgg@xxxxxxxx> wrote:
>
> 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@xxxxxxxxx>
> > ---
> >  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
Thanks!



[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