Re: [PATCH rdma-next] RDMA/rxe: Properly check tasklet state

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

 



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



[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