From: Leon Romanovsky <leon@kernel.org>
To: Bob Pearson <rpearsonhpe@gmail.com>
Cc: Dan Carpenter <error27@gmail.com>, linux-rdma@vger.kernel.org
Subject: Re: [bug report] RDMA/rxe: Rewrite rxe_task.c
Date: Wed, 29 Mar 2023 22:17:01 +0300 [thread overview]
Message-ID: <20230329191701.GG831478@unreal> (raw)
In-Reply-To: <ea0968af-4c12-dbc3-6b5d-67def5e039d0@gmail.com>
On Wed, Mar 29, 2023 at 02:09:17PM -0500, Bob Pearson wrote:
> On 3/29/23 01:48, Dan Carpenter wrote:
> > On Wed, Mar 29, 2023 at 09:27:26AM +0300, Dan Carpenter wrote:
> >> 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?
> >>
> >
> > The next function as well.
> >
> > drivers/infiniband/sw/rxe/rxe_task.c:49 __is_done() warn: bitwise AND condition is false here
> >
> > regards,
> > dan carpenter
> >
>
> Good catch. I was trying to open code the test in tasklet_schedule which was
> test_and_set_bit(TASKLET_STATE_SCHED, &t->state). I should have typed
>
> if (task->tasklet.state & (1 << TASKLET_STATE_BIT)) or similar.
What is wrong with test_bit(TASKLET_STATE_SCHED, &task->tasklet.state)?
Thanks
>
> Thanks,
>
> Bob
next prev parent reply other threads:[~2023-03-29 19:17 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-29 6:27 [bug report] RDMA/rxe: Rewrite rxe_task.c Dan Carpenter
2023-03-29 6:48 ` Dan Carpenter
2023-03-29 19:09 ` Bob Pearson
2023-03-29 19:17 ` Leon Romanovsky [this message]
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=20230329191701.GG831478@unreal \
--to=leon@kernel.org \
--cc=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