Skip to content

Commit

Permalink
padata: get_next is never NULL
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reported-by: Dan Carpenter <[email protected]>
Acked-by: Steffen Klassert <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
zx2c4 authored and herbertx committed Apr 21, 2017
1 parent c46ea13 commit 69b3484
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions kernel/padata.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,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.
Expand All @@ -182,8 +180,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);
Expand Down Expand Up @@ -235,12 +231,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;

/*
Expand Down

0 comments on commit 69b3484

Please sign in to comment.