lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 2 Aug 2019 15:45:57 +0200
From:   David Hildenbrand <david@...hat.com>
To:     Leonardo Bras <leonardo@...ux.ibm.com>,
        linuxppc-dev@...ts.ozlabs.org, linux-kernel@...r.kernel.org
Cc:     Benjamin Herrenschmidt <benh@...nel.crashing.org>,
        Paul Mackerras <paulus@...ba.org>,
        Michael Ellerman <mpe@...erman.id.au>,
        Pavel Tatashin <pavel.tatashin@...rosoft.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Oscar Salvador <osalvador@...e.de>,
        Nathan Fontenot <nfont@...ux.vnet.ibm.com>,
        Mahesh Salgaonkar <mahesh@...ux.vnet.ibm.com>,
        YueHaibing <yuehaibing@...wei.com>, Rob Herring <robh@...nel.org>
Subject: Re: [PATCH v2 1/1] powerpc/pseries/hotplug-memory.c: Change rc
 variable to bool

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@...ux.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@...hat.com>

-- 

Thanks,

David / dhildenb

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ