Commit 9c823f9f authored by Chen Gang's avatar Chen Gang Committed by Herbert Xu

padata - share code between CPU_ONLINE and CPU_DOWN_FAILED, same to...

padata - share code between CPU_ONLINE and CPU_DOWN_FAILED, same to CPU_DOWN_PREPARE and CPU_UP_CANCELED

Share code between CPU_ONLINE and CPU_DOWN_FAILED, same to
CPU_DOWN_PREPARE and CPU_UP_CANCELED.

It will fix 2 bugs:

  "not check the return value of __padata_remove_cpu() and __padata_add_cpu()".
  "need add 'break' between CPU_UP_CANCELED and CPU_DOWN_FAILED".
Signed-off-by: default avatarChen Gang <gang.chen@asianux.com>
Acked-by: default avatarSteffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent a246968e
...@@ -846,6 +846,8 @@ static int padata_cpu_callback(struct notifier_block *nfb, ...@@ -846,6 +846,8 @@ static int padata_cpu_callback(struct notifier_block *nfb,
switch (action) { switch (action) {
case CPU_ONLINE: case CPU_ONLINE:
case CPU_ONLINE_FROZEN: case CPU_ONLINE_FROZEN:
case CPU_DOWN_FAILED:
case CPU_DOWN_FAILED_FROZEN:
if (!pinst_has_cpu(pinst, cpu)) if (!pinst_has_cpu(pinst, cpu))
break; break;
mutex_lock(&pinst->lock); mutex_lock(&pinst->lock);
...@@ -857,6 +859,8 @@ static int padata_cpu_callback(struct notifier_block *nfb, ...@@ -857,6 +859,8 @@ static int padata_cpu_callback(struct notifier_block *nfb,
case CPU_DOWN_PREPARE: case CPU_DOWN_PREPARE:
case CPU_DOWN_PREPARE_FROZEN: case CPU_DOWN_PREPARE_FROZEN:
case CPU_UP_CANCELED:
case CPU_UP_CANCELED_FROZEN:
if (!pinst_has_cpu(pinst, cpu)) if (!pinst_has_cpu(pinst, cpu))
break; break;
mutex_lock(&pinst->lock); mutex_lock(&pinst->lock);
...@@ -865,22 +869,6 @@ static int padata_cpu_callback(struct notifier_block *nfb, ...@@ -865,22 +869,6 @@ static int padata_cpu_callback(struct notifier_block *nfb,
if (err) if (err)
return notifier_from_errno(err); return notifier_from_errno(err);
break; break;
case CPU_UP_CANCELED:
case CPU_UP_CANCELED_FROZEN:
if (!pinst_has_cpu(pinst, cpu))
break;
mutex_lock(&pinst->lock);
__padata_remove_cpu(pinst, cpu);
mutex_unlock(&pinst->lock);
case CPU_DOWN_FAILED:
case CPU_DOWN_FAILED_FROZEN:
if (!pinst_has_cpu(pinst, cpu))
break;
mutex_lock(&pinst->lock);
__padata_add_cpu(pinst, cpu);
mutex_unlock(&pinst->lock);
} }
return NOTIFY_OK; return NOTIFY_OK;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment