From: Leonardo Bras <hidden> Date: 2019-08-01 23:11:13
Changes the return variable to bool (as the return value) and
avoids doing a ternary operation before returning.
Also, since rc will always be true, there is no need to do
rc &= bool, as (true && X) will result in X.
Signed-off-by: Leonardo Bras <redacted>
---
arch/powerpc/platforms/pseries/hotplug-memory.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
From: David Hildenbrand <hidden> Date: 2019-08-02 07:18:57
On 02.08.19 01:10, Leonardo Bras wrote:
quoted hunk
Changes the return variable to bool (as the return value) and
avoids doing a ternary operation before returning.
Also, since rc will always be true, there is no need to do
rc &= bool, as (true && X) will result in X.
Signed-off-by: Leonardo Bras <redacted>
---
arch/powerpc/platforms/pseries/hotplug-memory.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
No, that's wrong.
If is_mem_section_removable() is false in the first iteration but true
in the last iteration, you would return true instead of false, which
introduced a bug. We have to AND all sub-results, not simply use the
last one.
From: David Hildenbrand <hidden> Date: 2019-08-02 07:23:20
On 02.08.19 09:18, David Hildenbrand wrote:
On 02.08.19 01:10, Leonardo Bras wrote:
quoted
Changes the return variable to bool (as the return value) and
avoids doing a ternary operation before returning.
Also, since rc will always be true, there is no need to do
rc &= bool, as (true && X) will result in X.
Signed-off-by: Leonardo Bras <redacted>
---
arch/powerpc/platforms/pseries/hotplug-memory.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
No, that's wrong.
If is_mem_section_removable() is false in the first iteration but true
in the last iteration, you would return true instead of false, which
introduced a bug. We have to AND all sub-results, not simply use the
last one.
BTW, including such subtle changes in a "Change rc variable to bool"
patch should be avoided.
--
Thanks,
David / dhildenb