Skip to contentSkip to conversation

drivers/firmware/psci: Assign @err directly in hotplug_tests()

PATCH Applied Gavin Shan 2 participants 2 messages Jun 30, 2020 – Jul 8, 2020 Power state coordination interface (psci)

lore
Share & tools
lore

Gavin Shan

author
#0 lore raw

PATCH v2 1/1 drivers/firmware/psci: Assign @err directly in hotplug_tests()

The return value of down_and_up_cpus() can be assigned to @err directly. With that, the useless assignment to @err with zero can be dropped.

---
v2: Pick r-b from Sudeep and rebase to 5.8.rc3

---
 drivers/firmware/psci/psci_checker.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/firmware/psci/psci_checker.c +1 -2
index d9b1a2d71223..3d6ba425dbb9 100644
@@ -199,13 +199,12 @@ static int hotplug_tests(void)
 	if (!page_buf)
 		goto out_free_cpu_groups;
 
-	err = 0;
 	/*
 	 * Of course the last CPU cannot be powered down and cpu_down() should
 	 * refuse doing that.
 	 */
 	pr_info("Trying to turn off and on again all CPUs\n");
-	err += down_and_up_cpus(cpu_online_mask, offlined_cpus);
+	err = down_and_up_cpus(cpu_online_mask, offlined_cpus);
 
 	/*
 	 * Take down CPUs by cpu group this time. When the last CPU is turned
Signature · 7 lines
2.23.0


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Applied
#1 lore raw
Quoted 2 lines · Gavin Shan

The return value of down_and_up_cpus() can be assigned to @err directly. With that, the useless assignment to @err with zero can be dropped.

Applied to arm64 (for-next/fixes), thanks!

[1/1] drivers/firmware/psci: Assign @err directly in hotplug_tests()

      https://git.kernel.org/arm64/c/132330f8044c

Cheers,

Signature · 10 lines
Will

https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel