]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
drivers/firmware/psci: Assign @err directly in hotplug_tests()
authorGavin Shan <gshan@redhat.com>
Tue, 30 Jun 2020 07:59:43 +0000 (17:59 +1000)
committerWill Deacon <will@kernel.org>
Wed, 8 Jul 2020 20:41:24 +0000 (21:41 +0100)
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.

Signed-off-by: Gavin Shan <gshan@redhat.com>
Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>
Link: https://lore.kernel.org/r/20200630075943.203954-1-gshan@redhat.com
Signed-off-by: Will Deacon <will@kernel.org>
drivers/firmware/psci/psci_checker.c

index d9b1a2d71223e47a7062741277d0509714aae0c3..3d6ba425dbb9f2f60f32900b0d107fb5e1797bfc 100644 (file)
@@ -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