lkml.org 
[lkml]   [2019]   [Aug]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/1] pseries/hotplug-memory.c: Change rc variable to bool
Date
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 <leonardo@linux.ibm.com>
---
arch/powerpc/platforms/pseries/hotplug-memory.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries/hotplug-memory.c
index 8e700390f3d6..392deb4855e5 100644
--- a/arch/powerpc/platforms/pseries/hotplug-memory.c
+++ b/arch/powerpc/platforms/pseries/hotplug-memory.c
@@ -338,7 +338,7 @@ static int pseries_remove_mem_node(struct device_node *np)
static bool lmb_is_removable(struct drmem_lmb *lmb)
{
int i, scns_per_block;
- int rc = 1;
+ bool rc = true;
unsigned long pfn, block_sz;
u64 phys_addr;

@@ -363,11 +363,11 @@ static bool lmb_is_removable(struct drmem_lmb *lmb)
if (!pfn_present(pfn))
continue;

- rc &= is_mem_section_removable(pfn, PAGES_PER_SECTION);
+ rc = is_mem_section_removable(pfn, PAGES_PER_SECTION);
phys_addr += MIN_MEMORY_BLOCK_SIZE;
}

- return rc ? true : false;
+ return rc;
}

static int dlpar_add_lmb(struct drmem_lmb *);
--
2.20.1
\
 
 \ /
  Last update: 2019-08-02 01:12    [W:2.225 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site