Thread (3 messages) flat view 3 messages, 2 authors, 2021-06-01

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

From: Jinpu Wang <jinpu.wang@ionos.com>
Date: 2021-06-01 05:02:59

On Mon, May 31, 2021 at 8:43 PM Jason Gunthorpe [off-list ref] wrote:
On Mon, May 31, 2021 at 02:28:35PM +0200, Jack Wang wrote:
quoted
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
Thanks!
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help