[v2,1/2] powerpc/pseries: address checkpatch warnings in dlpar_offline_cpu
diff mbox series

Message ID 20191016183611.10867-2-nathanl@linux.ibm.com
State Accepted
Commit 3366ebe9e19ba3c672a00a6fb86f0ac8636ee989
Headers show
Series
  • safely roll back failed DLPAR cpu add
Related show

Checks

Context Check Description
snowpatch_ozlabs/checkpatch success total: 0 errors, 0 warnings, 0 checks, 31 lines checked
snowpatch_ozlabs/apply_patch success Successfully applied on branch next (600802af9049be799465b24d14162918545634bf)

Commit Message

Nathan Lynch Oct. 16, 2019, 6:36 p.m. UTC
Remove some stray blank lines, convert a printk to pr_warn, and
address a line length violation.

One functional change: use WARN_ON instead of BUG_ON in case H_PROD of
a ceded thread yields an unexpected result from the platform. We can
expect this code path to get uninterruptibly stuck in __cpu_die() if
this happens, but that's more desirable than crashing.

Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
Fixes: b6db63d1a7f0 ("pseries/pseries: Add code to online/offline CPUs of a DLPAR node")
---
 arch/powerpc/platforms/pseries/hotplug-cpu.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

Comments

Michael Ellerman Nov. 14, 2019, 9:07 a.m. UTC | #1
On Wed, 2019-10-16 at 18:36:10 UTC, Nathan Lynch wrote:
> Remove some stray blank lines, convert a printk to pr_warn, and
> address a line length violation.
> 
> One functional change: use WARN_ON instead of BUG_ON in case H_PROD of
> a ceded thread yields an unexpected result from the platform. We can
> expect this code path to get uninterruptibly stuck in __cpu_die() if
> this happens, but that's more desirable than crashing.
> 
> Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
> Fixes: b6db63d1a7f0 ("pseries/pseries: Add code to online/offline CPUs of a DLPAR node")

Series applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/3366ebe9e19ba3c672a00a6fb86f0ac8636ee989

cheers

Patch
diff mbox series

diff --git a/arch/powerpc/platforms/pseries/hotplug-cpu.c b/arch/powerpc/platforms/pseries/hotplug-cpu.c
index bbda646b63b5..f3f54ef645e1 100644
--- a/arch/powerpc/platforms/pseries/hotplug-cpu.c
+++ b/arch/powerpc/platforms/pseries/hotplug-cpu.c
@@ -539,7 +539,6 @@  static int dlpar_offline_cpu(struct device_node *dn)
 					goto out;
 				cpu_maps_update_begin();
 				break;
-
 			}
 
 			/*
@@ -547,19 +546,19 @@  static int dlpar_offline_cpu(struct device_node *dn)
 			 * Upgrade it's state to CPU_STATE_OFFLINE.
 			 */
 			set_preferred_offline_state(cpu, CPU_STATE_OFFLINE);
-			BUG_ON(plpar_hcall_norets(H_PROD, thread)
-								!= H_SUCCESS);
+			WARN_ON(plpar_hcall_norets(H_PROD, thread) != H_SUCCESS);
 			__cpu_die(cpu);
 			break;
 		}
-		if (cpu == num_possible_cpus())
-			printk(KERN_WARNING "Could not find cpu to offline with physical id 0x%x\n", thread);
+		if (cpu == num_possible_cpus()) {
+			pr_warn("Could not find cpu to offline with physical id 0x%x\n",
+				thread);
+		}
 	}
 	cpu_maps_update_done();
 
 out:
 	return rc;
-
 }
 
 static ssize_t dlpar_cpu_remove(struct device_node *dn, u32 drc_index)