Skip to content

Commit b948aaa

Browse files
LeoBrasmpe
authored andcommitted
powerpc/pseries/hotplug-memory: Change rc variable to bool
Changes the return variable to bool (as the return value) and avoids doing a ternary operation before returning. Signed-off-by: Leonardo Bras <leonardo@linux.ibm.com> Reviewed-by: David Hildenbrand <david@redhat.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20190802133914.30413-1-leonardo@linux.ibm.com
1 parent f581719 commit b948aaa

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

arch/powerpc/platforms/pseries/hotplug-memory.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ static int pseries_remove_mem_node(struct device_node *np)
338338
static bool lmb_is_removable(struct drmem_lmb *lmb)
339339
{
340340
int i, scns_per_block;
341-
int rc = 1;
341+
bool rc = true;
342342
unsigned long pfn, block_sz;
343343
u64 phys_addr;
344344

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

366-
rc &= is_mem_section_removable(pfn, PAGES_PER_SECTION);
366+
rc = rc && is_mem_section_removable(pfn, PAGES_PER_SECTION);
367367
phys_addr += MIN_MEMORY_BLOCK_SIZE;
368368
}
369369

370-
return rc ? true : false;
370+
return rc;
371371
}
372372

373373
static int dlpar_add_lmb(struct drmem_lmb *);

0 commit comments

Comments
 (0)