On Wed, Mar 29, 2023 at 02:15:30PM -0500, Bob Pearson wrote: > On 3/29/23 13:18, Leon Romanovsky wrote: > > From: Leon Romanovsky <leonro@xxxxxxxxxx> > > > > Fix the following smatch error: > > > > drivers/infiniband/sw/rxe/rxe_task.c:24 __reserve_if_idle() > > warn: bitwise AND condition is false here > > > > Fixes: d94671632572 ("RDMA/rxe: Rewrite rxe_task.c") > > Reported-by: Dan Carpenter <error27@xxxxxxxxx> > > Link: https://lore.kernel.org/all/480b32b6-0f1c-4646-9ecc-e0760004cd24@kili.mountain > > Signed-off-by: Leon Romanovsky <leonro@xxxxxxxxxx> > > --- > > drivers/infiniband/sw/rxe/rxe_task.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/infiniband/sw/rxe/rxe_task.c b/drivers/infiniband/sw/rxe/rxe_task.c > > index fea9a517c8d9..48c89987137c 100644 > > --- a/drivers/infiniband/sw/rxe/rxe_task.c > > +++ b/drivers/infiniband/sw/rxe/rxe_task.c > > @@ -21,7 +21,7 @@ static bool __reserve_if_idle(struct rxe_task *task) > > { > > WARN_ON(rxe_read(task->qp) <= 0); > > > > - if (task->tasklet.state & TASKLET_STATE_SCHED) > > + if (task->tasklet.state == TASKLET_STATE_SCHED) > > return false; > > > > if (task->state == TASK_STATE_IDLE) { > > @@ -46,7 +46,7 @@ static bool __reserve_if_idle(struct rxe_task *task) > > */ > > static bool __is_done(struct rxe_task *task) > > { > > - if (task->tasklet.state & TASKLET_STATE_SCHED) > > + if (task->tasklet.state == TASKLET_STATE_SCHED) > > return false; > > > > if (task->state == TASK_STATE_IDLE || > > Leon, This is not correct either. I am about to fix this. -- Bob Sure, no problem. Thanks