Commit 3366ebe9 authored by Nathan Lynch's avatar Nathan Lynch Committed by Michael Ellerman
Browse files

powerpc/pseries: address checkpatch warnings in dlpar_offline_cpu



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: default avatarNathan Lynch <nathanl@linux.ibm.com>
Fixes: b6db63d1 ("pseries/pseries: Add code to online/offline CPUs of a DLPAR node")
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20191016183611.10867-2-nathanl@linux.ibm.com
parent 50512706
Loading
Loading
Loading
Loading
+5 −6
Original line number Diff line number Diff line
@@ -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)