diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2017-04-12 10:40:19 +0200 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2020-05-22 21:19:12 +0100 |
commit | 51cc7091b3cb99ea5a2f2837c310e73e2a9d9b01 (patch) | |
tree | 89f43d8135ec9bb6386b288125b3b95bb39128b5 | |
parent | 03ce37900306d2a7d40dff2c2246f03fd0f3381e (diff) | |
download | linux-stable-51cc7091b3cb99ea5a2f2837c310e73e2a9d9b01.tar.gz |
padata: get_next is never NULL
commit 69b348449bda0f9588737539cfe135774c9939a7 upstream.
Per Dan's static checker warning, the code that returns NULL was removed
in 2010, so this patch updates the comments and fixes the code
assumptions.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
-rw-r--r-- | kernel/padata.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/kernel/padata.c b/kernel/padata.c index b2a3402dc9593..8b95e318408d2 100644 --- a/kernel/padata.c +++ b/kernel/padata.c @@ -153,8 +153,6 @@ EXPORT_SYMBOL(padata_do_parallel); * A pointer to the control struct of the next object that needs * serialization, if present in one of the percpu reorder queues. * - * NULL, if all percpu reorder queues are empty. - * * -EINPROGRESS, if the next object that needs serialization will * be parallel processed by another cpu and is not yet present in * the cpu's reorder queue. @@ -181,8 +179,6 @@ static struct padata_priv *padata_get_next(struct parallel_data *pd) cpu = padata_index_to_cpu(pd, next_index); next_queue = per_cpu_ptr(pd->pqueue, cpu); - padata = NULL; - reorder = &next_queue->reorder; spin_lock(&reorder->lock); @@ -234,12 +230,11 @@ static void padata_reorder(struct parallel_data *pd) padata = padata_get_next(pd); /* - * All reorder queues are empty, or the next object that needs - * serialization is parallel processed by another cpu and is - * still on it's way to the cpu's reorder queue, nothing to - * do for now. + * If the next object that needs serialization is parallel + * processed by another cpu and is still on it's way to the + * cpu's reorder queue, nothing to do for now. */ - if (!padata || PTR_ERR(padata) == -EINPROGRESS) + if (PTR_ERR(padata) == -EINPROGRESS) break; /* |