public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: rpearsonhpe@gmail.com
Cc: linux-rdma@vger.kernel.org
Subject: [bug report] RDMA/rxe: Rewrite rxe_task.c
Date: Wed, 29 Mar 2023 09:27:26 +0300	[thread overview]
Message-ID: <480b32b6-0f1c-4646-9ecc-e0760004cd24@kili.mountain> (raw)

Hello Bob Pearson,

The patch d94671632572: "RDMA/rxe: Rewrite rxe_task.c" from Mar 4,
2023, leads to the following Smatch static checker warning:

	drivers/infiniband/sw/rxe/rxe_task.c:24 __reserve_if_idle()
	warn: bitwise AND condition is false here

drivers/infiniband/sw/rxe/rxe_task.c
    20 static bool __reserve_if_idle(struct rxe_task *task)
    21 {
    22         WARN_ON(rxe_read(task->qp) <= 0);
    23 
--> 24         if (task->tasklet.state & TASKLET_STATE_SCHED)
                                         ^^^^^^^^^^^^^^^^^^^
This is zero.  Should the check be == TASKLET_STATE_SCHED?

    25                 return false;
    26 
    27         if (task->state == TASK_STATE_IDLE) {
    28                 rxe_get(task->qp);
    29                 task->state = TASK_STATE_BUSY;
    30                 task->num_sched++;
    31                 return true;
    32         }
    33 
    34         if (task->state == TASK_STATE_BUSY)
    35                 task->state = TASK_STATE_ARMED;
    36 
    37         return false;
    38 }

regards,
dan carpenter

             reply	other threads:[~2023-03-29  6:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-29  6:27 Dan Carpenter [this message]
2023-03-29  6:48 ` [bug report] RDMA/rxe: Rewrite rxe_task.c Dan Carpenter
2023-03-29 19:09   ` Bob Pearson
2023-03-29 19:17     ` Leon Romanovsky
2023-03-30  4:06     ` Dan Carpenter
2023-03-29 18:22 ` Leon Romanovsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=480b32b6-0f1c-4646-9ecc-e0760004cd24@kili.mountain \
    --to=error27@gmail.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=rpearsonhpe@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox