db: move an assignment outside the loop
commit4d7d9368a19656d99f7f63be5cf3a5116e77a9b2
authorDan Carpenter <dan.carpenter@linaro.org>
Tue, 27 Jun 2023 09:41:53 +0000 (27 12:41 +0300)
committerDan Carpenter <dan.carpenter@linaro.org>
Tue, 27 Jun 2023 09:41:53 +0000 (27 12:41 +0300)
treefc68ea28cce853a0cad50c98cbef172b7900b226
parent9e89761c63cc7e62885ea53b99c817ba7c2ca097
db: move an assignment outside the loop

The "arg" is going to be the same for every iteration so we can move
that assignment outside the loop.

While reviewing it, I decided that having a -1 parameter doesn't make
sense and we would have to lookup the parent_expr to get access to it.
It was easier to return failure on that path.

However, it turned out that the sleep_info was using -1 as a no parameter
option.  Which is wrong.  -2 is the no parameter option.  So let's change
that and still return failure for the -1 case.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
check_sleep_info.c
smatch_db.c