Skip to content

Commit f0fcf20

Browse files
shanweiherbertx
authored andcommitted
padata: use __this_cpu_read per-cpu helper
For bottom halves off, __this_cpu_read is better. Signed-off-by: Shan Wei <davidshan@tencent.com> Reviewed-by: Christoph Lameter <cl@linux.com> Acked-by: Steffen Klassert <steffen.klassert@secunet.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
1 parent a465348 commit f0fcf20

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

‎kernel/padata.c‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ static struct padata_priv *padata_get_next(struct parallel_data *pd)
171171
{
172172
int cpu, num_cpus;
173173
unsigned int next_nr, next_index;
174-
struct padata_parallel_queue *queue, *next_queue;
174+
struct padata_parallel_queue *next_queue;
175175
struct padata_priv *padata;
176176
struct padata_list *reorder;
177177

@@ -204,8 +204,7 @@ static struct padata_priv *padata_get_next(struct parallel_data *pd)
204204
goto out;
205205
}
206206

207-
queue = per_cpu_ptr(pd->pqueue, smp_processor_id());
208-
if (queue->cpu_index == next_queue->cpu_index) {
207+
if (__this_cpu_read(pd->pqueue->cpu_index) == next_queue->cpu_index) {
209208
padata = ERR_PTR(-ENODATA);
210209
goto out;
211210
}

0 commit comments

Comments
 (0)