From: David Hildenbrand <david@redhat.com>
To: Leonardo Bras <leonardo@linux.ibm.com>,
linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Paul Mackerras <paulus@samba.org>,
Michael Ellerman <mpe@ellerman.id.au>,
Pavel Tatashin <pavel.tatashin@microsoft.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Oscar Salvador <osalvador@suse.de>,
Nathan Fontenot <nfont@linux.vnet.ibm.com>,
Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>,
YueHaibing <yuehaibing@huawei.com>, Rob Herring <robh@kernel.org>
Subject: Re: [PATCH v2 1/1] powerpc/pseries/hotplug-memory.c: Change rc variable to bool
Date: Fri, 2 Aug 2019 15:45:57 +0200 [thread overview]
Message-ID: <dd417c2c-83f6-b3e0-0a87-25996af76db5@redhat.com> (raw)
In-Reply-To: <20190802133914.30413-1-leonardo@linux.ibm.com>
On 02.08.19 15:39, Leonardo Bras wrote:
> 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>
> ---
> Changes in v2:
> - Restore previous and-ing logic on rc.
>
> 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..c126b94d1943 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 = 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 *);
>
Yeah, why not
Reviewed-by: David Hildenbrand <david@redhat.com>
--
Thanks,
David / dhildenb
next prev parent reply other threads:[~2019-08-02 13:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-02 13:39 Leonardo Bras
2019-08-02 13:45 ` David Hildenbrand [this message]
2019-09-20 1:57 ` Leonardo Bras
2019-11-14 9:07 ` Michael Ellerman
2019-11-14 18:25 ` Leonardo Bras
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=dd417c2c-83f6-b3e0-0a87-25996af76db5@redhat.com \
--to=david@redhat.com \
--cc=benh@kernel.crashing.org \
--cc=gregkh@linuxfoundation.org \
--cc=leonardo@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mahesh@linux.vnet.ibm.com \
--cc=mpe@ellerman.id.au \
--cc=nfont@linux.vnet.ibm.com \
--cc=osalvador@suse.de \
--cc=paulus@samba.org \
--cc=pavel.tatashin@microsoft.com \
--cc=robh@kernel.org \
--cc=yuehaibing@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®