* [PATCH] drivers/firmware/psci: Assign @err directly in hotplug_tests()
@ 2020-01-30 23:08 Gavin Shan
2020-01-31 15:36 ` Sudeep Holla
0 siblings, 1 reply; 3+ messages in thread
From: Gavin Shan @ 2020-01-30 23:08 UTC (permalink / raw)
To: linux-arm-kernel; +Cc: mark.rutland, lorenzo.pieralisi, sudeep.holla
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>
---
drivers/firmware/psci/psci_checker.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/firmware/psci/psci_checker.c b/drivers/firmware/psci/psci_checker.c
index 03eb798ad3ed..0e1c92e2f91a 100644
--- a/drivers/firmware/psci/psci_checker.c
+++ b/drivers/firmware/psci/psci_checker.c
@@ -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
--
2.23.0
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] drivers/firmware/psci: Assign @err directly in hotplug_tests()
2020-01-30 23:08 [PATCH] drivers/firmware/psci: Assign @err directly in hotplug_tests() Gavin Shan
@ 2020-01-31 15:36 ` Sudeep Holla
2020-02-02 22:17 ` Gavin Shan
0 siblings, 1 reply; 3+ messages in thread
From: Sudeep Holla @ 2020-01-31 15:36 UTC (permalink / raw)
To: Gavin Shan
Cc: mark.rutland, lorenzo.pieralisi, linux-arm-kernel, Sudeep Holla
On Fri, Jan 31, 2020 at 10:08:45AM +1100, Gavin Shan wrote:
> 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.
>
Yes, I was wondering why it's done like this. It may be result of some
refactoring that we ended up with this. Anyways, looks good to me.
Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>
--
Regards,
Sudeep
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] drivers/firmware/psci: Assign @err directly in hotplug_tests()
2020-01-31 15:36 ` Sudeep Holla
@ 2020-02-02 22:17 ` Gavin Shan
0 siblings, 0 replies; 3+ messages in thread
From: Gavin Shan @ 2020-02-02 22:17 UTC (permalink / raw)
To: Sudeep Holla; +Cc: mark.rutland, lorenzo.pieralisi, linux-arm-kernel
On 2/1/20 2:36 AM, Sudeep Holla wrote:
> On Fri, Jan 31, 2020 at 10:08:45AM +1100, Gavin Shan wrote:
>> 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.
>>
>
> Yes, I was wondering why it's done like this. It may be result of some
> refactoring that we ended up with this. Anyways, looks good to me.
>
> Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>
>
Thanks, Sudeep. Yeah, It was introduced by commit ea8b1c4a6019
("drivers: psci: PSCI checker module").
Thanks,
Gavin
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-02-02 22:17 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-01-30 23:08 [PATCH] drivers/firmware/psci: Assign @err directly in hotplug_tests() Gavin Shan
2020-01-31 15:36 ` Sudeep Holla
2020-02-02 22:17 ` Gavin Shan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).